Closed krissss closed 1 year ago
config/container.php
return (new Webman\Container) ->addDefinitions(config('dependence', []));
config/dependence.php
use Psr\Container\ContainerInterface; return [ 'abc' => function (ContainerInterface $container) { return 'XYZ' } ];
use support\Container; $is = Container::has('abc'); // true $value = Container::get('abc'); // XYZ
Thank 👍
config
config/container.php
config/dependence.php
usage