h3x3d/container

此软件包最新版本(dev-master)没有可用的许可证信息。

简单的依赖注入容器

此软件包的官方仓库似乎已消失,因此该软件包已被冻结。

dev-master 2016-04-19 14:36 UTC

This package is not auto-updated.

Last update: 2024-01-31 21:17:45 UTC


README

$cont = new \H3x3d\Container();
// $cont = \H3x3d\Container::instance();
$cont->set('test', function ($c) {
    return 10;
});

$cont->set('test1', function ($c, $test) {
    echo $test;

    return $test;
});

$cont->get('test1', 'I\'m test variable');

$f = $cont->factory('test1');

$f('test123');