Advertisement
sumakaki

config.php

Feb 16th, 2021
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2. use function DI\create;
  3. use function DI\get;
  4.  
  5. $builder = new \DI\ContainerBuilder();
  6. $builder->useAutowiring(false);
  7. $builder->useAnnotations(false);
  8.  
  9. $builder->addDefinitions([
  10.     'FilesystemLoader' => function(ContainerInterface $c){
  11.         return new \Twig\Loader\FilesystemLoader('templates');
  12.     },
  13.     'Environment' => function(ContainerInterface $c){
  14.         return \Twig\Environment($c->get('FilesystemLoader'));
  15.     },
  16.     'HomeController' => function(ContainerInterface $c){
  17.         return  app\Http\Controllers\HomeController($c->get('Environment'));
  18.  
  19.     }
  20. ]);
  21.  
  22. $container = $builder->build();
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement