Skip to content

php-lab/di

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependency injection container

Build Status Scrutinizer Code Quality Total Downloads License

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.

About

Dependency injection container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages