| @@ 20-56 (lines=37) @@ | ||
| 17 | use Symfony\Component\HttpKernel\Kernel; |
|
| 18 | use Symfony\Component\Routing\RouteCollectionBuilder; |
|
| 19 | ||
| 20 | class ComponentKernel extends Kernel |
|
| 21 | { |
|
| 22 | use MicroKernelTrait; |
|
| 23 | ||
| 24 | public function registerBundles() |
|
| 25 | { |
|
| 26 | return [ |
|
| 27 | new FrameworkBundle(), |
|
| 28 | new TwigBundle(), |
|
| 29 | ]; |
|
| 30 | } |
|
| 31 | ||
| 32 | protected function configureRoutes(RouteCollectionBuilder $routes) |
|
| 33 | { |
|
| 34 | $routes->add('/', SymfonyUtil\Controller\EngineAsArgumentController::class, 'index'); |
|
| 35 | } |
|
| 36 | ||
| 37 | protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) |
|
| 38 | { |
|
| 39 | //Controllers |
|
| 40 | $c->autowire(SymfonyUtil\Controller\EngineAsArgumentController::class) |
|
| 41 | ->setAutoconfigured(true) |
|
| 42 | ->addTag('controller.service_arguments') |
|
| 43 | ->setPublic(false); |
|
| 44 | ||
| 45 | // Extensions |
|
| 46 | $c->loadFromExtension('framework', [ |
|
| 47 | 'secret' => 'NotSecret', // What about use $ uuid -v4 or $ uuidgen |
|
| 48 | 'test' => in_array($this->getEnvironment(), ['test'], true), // test.client service for eg. PHPUnit |
|
| 49 | 'templating' => ['engines' => 'twig'], |
|
| 50 | ]); |
|
| 51 | $c->loadFromExtension('twig', [ |
|
| 52 | 'debug' => true, |
|
| 53 | 'paths' => ['%kernel.project_dir%/tests/templates'], |
|
| 54 | ]); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||
| @@ 20-56 (lines=37) @@ | ||
| 17 | use Symfony\Component\HttpKernel\Kernel; |
|
| 18 | use Symfony\Component\Routing\RouteCollectionBuilder; |
|
| 19 | ||
| 20 | class FrameworkKernel extends Kernel |
|
| 21 | { |
|
| 22 | use MicroKernelTrait; |
|
| 23 | ||
| 24 | public function registerBundles() |
|
| 25 | { |
|
| 26 | return [ |
|
| 27 | new FrameworkBundle(), |
|
| 28 | new TwigBundle(), |
|
| 29 | ]; |
|
| 30 | } |
|
| 31 | ||
| 32 | protected function configureRoutes(RouteCollectionBuilder $routes) |
|
| 33 | { |
|
| 34 | $routes->add('/', SymfonyUtil\Controller\EngineAsArgumentController::class, 'index'); |
|
| 35 | } |
|
| 36 | ||
| 37 | protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) |
|
| 38 | { |
|
| 39 | //Controllers |
|
| 40 | $c->autowire(SymfonyUtil\Controller\EngineAsArgumentController::class) |
|
| 41 | ->setAutoconfigured(true) |
|
| 42 | ->addTag('controller.service_arguments') |
|
| 43 | ->setPublic(false); |
|
| 44 | ||
| 45 | // Extensions |
|
| 46 | $c->loadFromExtension('framework', [ |
|
| 47 | 'secret' => 'NotSecret', // What about use $ uuid -v4 or $ uuidgen |
|
| 48 | 'test' => in_array($this->getEnvironment(), ['test'], true), // test.client service for eg. PHPUnit |
|
| 49 | 'templating' => ['engines' => 'twig'], |
|
| 50 | ]); |
|
| 51 | $c->loadFromExtension('twig', [ |
|
| 52 | 'debug' => true, |
|
| 53 | 'paths' => ['%kernel.project_dir%/tests/templates'], |
|
| 54 | ]); |
|
| 55 | } |
|
| 56 | } |
|
| 57 | ||