Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use function DI\create;
- use function DI\get;
- $builder = new \DI\ContainerBuilder();
- $builder->useAutowiring(false);
- $builder->useAnnotations(false);
- $builder->addDefinitions([
- 'FilesystemLoader' => function(ContainerInterface $c){
- return new \Twig\Loader\FilesystemLoader('templates');
- },
- 'Environment' => function(ContainerInterface $c){
- return \Twig\Environment($c->get('FilesystemLoader'));
- },
- 'HomeController' => function(ContainerInterface $c){
- return app\Http\Controllers\HomeController($c->get('Environment'));
- }
- ]);
- $container = $builder->build();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement