php-lab / di
Dependency injection container.
Installs: 137
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/php-lab/di
Requires
- php: >=7.0
This package is auto-updated.
Last update: 2025-09-22 22:08:18 UTC
README
PhpLab\Di requires PHP 7.
Usage
use PhpLab\Di\Container; $app = new Container(); $app->pageIndexAction = function (Container $di) { return new \Page\Action\IndexAction($di->pageIndexResponder); }; $app->pageIndexResponder = function (Container $di) { return new \Page\Responder\IndexResponder($di->pageIndexTemplate); }; $app->pageIndexTemplate = function (Container $di) { return new \Page\Template\IndexTemplate($di['path.template']); }; $app['path.root'] = __DIR__ . '/../..'; $app['path.template'] = $app['path.root'] . '/template/site';
License
PhpLab\Di is licensed under the MIT license.