1. Go to this page and download the library: Download webiik/container library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webiik / container example snippets
$container = new \Webiik\Container\Container();
$container->addService('\Webiik\Arr\Arr', function () {
return new \Webiik\Arr\Arr();
});
$array = $container->get('\Webiik\Arr\Arr');
addService(string $name, callable $factory): void
$container->addService('\Webiik\Arr\Arr', function () {
return new \Webiik\Arr\Arr();
});
$container->addService('Service', function ($container) {
// $container - Container
});