Symfony Exception

RuntimeException

HTTP 500 Internal Server Error

No engine is able to work with the template "countries/index.html.twig".

Exception

RuntimeException

  1.             if ($engine->supports($name)) {
  2.                 return $engine;
  3.             }
  4.         }
  5.         throw new \RuntimeException(sprintf('No engine is able to work with the template "%s".'$name));
  6.     }
  7. }
  1.      */
  2.     public function getEngine($name)
  3.     {
  4.         $this->resolveEngines();
  5.         return parent::getEngine($name);
  6.     }
  7.     /**
  8.      * {@inheritdoc}
  9.      */
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function render($name, array $parameters = [])
  5.     {
  6.         return $this->getEngine($name)->render($name$parameters);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      */
  1.     protected function render(string $view, array $parameters = [], Response $response null): Response
  2.     {
  3.         if ($this->container->has('templating')) {
  4.             @trigger_error('Using the "templating" service is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.'E_USER_DEPRECATED);
  5.             $content $this->container->get('templating')->render($view$parameters);
  6.         } elseif ($this->container->has('twig')) {
  7.             $content $this->container->get('twig')->render($view$parameters);
  8.         } else {
  9.             throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
  10.         }
Controller->render() in src/Controller/CountriesController.php (line 16)
  1.      * @Route("/countries", name="countries")
  2.      */
  3.     public function index()
  4.     {
  5.         return $this->render('countries/index.html.twig', [
  6.             'controller_name' => 'CountriesController',
  7.         ]);
  8.     }
  9. }
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 36)
  1. $kernel = new Kernel($env$debug);
  2. $request Request::createFromGlobals();
  3. $response $kernel->handle($request);
  4. $response->send();
  5. $kernel->terminate($request$response);

Stack Trace

RuntimeException

RuntimeException:
No engine is able to work with the template "countries/index.html.twig".

  at vendor/symfony/templating/DelegatingEngine.php:101
  at Symfony\Component\Templating\DelegatingEngine->getEngine()
     (vendor/symfony/framework-bundle/Templating/DelegatingEngine.php:44)
  at Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine->getEngine()
     (vendor/symfony/templating/DelegatingEngine.php:41)
  at Symfony\Component\Templating\DelegatingEngine->render()
     (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:233)
  at Symfony\Bundle\FrameworkBundle\Controller\Controller->render()
     (src/Controller/CountriesController.php:16)
  at App\Controller\CountriesController->index()
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:36)