Symfony Exception

Twig_Error_Runtime

HTTP 500 Internal Server Error

Variable "backToDevMale" does not exist.

Exception

Twig_Error_Runtime

  1.                         <span class="navbar-brand">{% if model.ime is defined %} {{ model.ime|upper }} {{ model.priimek|upper }} {% endif%}</span>
  2.                         <div class="collapse navbar-collapse justify-content-end">
  3.                             <ul class="navbar-nav">
  4.                                 <li class="nav-item">
  5.                                     <a class="nav-link" {% if backToDev is defined and backToDev == true %} href="{{ path('modelInfoDev', {id: model.id}) }}" {% elseif backToDevMale and backToDevMale == true %} href="{{ path('modelInfoDevMale', {id: model.id}) }}" {% else %} href="{{ path('modelInfo', {id: model.id}) }}" {% endif %}>BOOK<span class="sr-only">(current)</span></a>
  6.                                 </li>
  7.                                 <li class="nav-item">
  8.                                     <a class="nav-link nav-item-span" href="#">/</a>
  9.                                 </li>
  10.                                 <li class="nav-item">
__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389->{closure}() in var/cache/dev/twig/b4/b469069acb14f43ae030f37022ac9869bebbc0e87b5bb3b5780fe37060931cff.php (line 74)
  1.         // line 22
  2.         if ((array_key_exists("backToDev"$context) && ((isset($context["backToDev"]) || array_key_exists("backToDev"$context) ? $context["backToDev"] : (function () { throw new Twig_Error_Runtime('Variable "backToDev" does not exist.'22$this->getSourceContext()); })()) == true))) {
  3.             echo " href=\"";
  4.             echo twig_escape_filter($this->env$this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath("modelInfoDev", array("id" => twig_get_attribute($this->env$this->getSourceContext(), (isset($context["model"]) || array_key_exists("model"$context) ? $context["model"] : (function () { throw new Twig_Error_Runtime('Variable "model" does not exist.'22$this->getSourceContext()); })()), "id", array()))), "html"nulltrue);
  5.             echo "\" ";
  6.         } elseif (((isset($context["backToDevMale"]) || array_key_exists("backToDevMale"$context) ? $context["backToDevMale"] : (function () { throw new Twig_Error_Runtime('Variable "backToDevMale" does not exist.'22$this->getSourceContext()); })()) && ((isset($context["backToDevMale"]) || array_key_exists("backToDevMale"$context) ? $context["backToDevMale"] : (function () { throw new Twig_Error_Runtime('Variable "backToDevMale" does not exist.'22$this->getSourceContext()); })()) == true))) {
  7.             echo " href=\"";
  8.             echo twig_escape_filter($this->env$this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath("modelInfoDevMale", array("id" => twig_get_attribute($this->env$this->getSourceContext(), (isset($context["model"]) || array_key_exists("model"$context) ? $context["model"] : (function () { throw new Twig_Error_Runtime('Variable "model" does not exist.'22$this->getSourceContext()); })()), "id", array()))), "html"nulltrue);
  9.             echo "\" ";
  10.         } else {
  11.             echo " href=\"";
__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389->block_body(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts'))) in vendor/twig/twig/lib/Twig/Template.php (line 188)
  1.             throw new LogicException('A block must be a method on a Twig_Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Twig_Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
Twig_Template->displayBlock('body', array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts'))) in var/cache/dev/twig/61/618ea4687aa6247b8f0d59d4a73c7b36a3508bbb4077fa9e94b269b1311266f2.php (line 50)
  1.         echo "</head>
  2. <body>
  3.     ";
  4.         // line 18
  5.         $this->displayBlock('body'$context$blocks);
  6.         // line 19
  7.         echo "
  8.     <script src=\"";
  9.         // line 21
__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35->doDisplay(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts'))) in vendor/twig/twig/lib/Twig/Template.php (line 389)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = array())
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Twig_Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
Twig_Template->displayWithErrorHandling(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts'))) in vendor/twig/twig/lib/Twig/Template.php (line 366)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = array())
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
Twig_Template->display(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'))) in var/cache/dev/twig/b4/b469069acb14f43ae030f37022ac9869bebbc0e87b5bb3b5780fe37060931cff.php (line 27)
  1.     protected function doDisplay(array $context, array $blocks = array())
  2.     {
  3.         $__internal_0ad5946553525ef5637ac0b3266bbf5dabd4da1d9da82eaeb52c54ad37154c69 $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
  4.         $__internal_0ad5946553525ef5637ac0b3266bbf5dabd4da1d9da82eaeb52c54ad37154c69->enter($__internal_0ad5946553525ef5637ac0b3266bbf5dabd4da1d9da82eaeb52c54ad37154c69_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template""model/videos.html.twig"));
  5.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  6.         
  7.         $__internal_0ad5946553525ef5637ac0b3266bbf5dabd4da1d9da82eaeb52c54ad37154c69->leave($__internal_0ad5946553525ef5637ac0b3266bbf5dabd4da1d9da82eaeb52c54ad37154c69_prof);
  8.     }
__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389->doDisplay(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'))) in vendor/twig/twig/lib/Twig/Template.php (line 389)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = array())
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Twig_Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
Twig_Template->displayWithErrorHandling(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'))) in vendor/twig/twig/lib/Twig/Template.php (line 366)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = array())
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
Twig_Template->display(array('error' => 'Could not load data for model from database. Please try again.')) in vendor/twig/twig/lib/Twig/Template.php (line 374)
  1.     public function render(array $context)
  2.     {
  3.         $level ob_get_level();
  4.         ob_start();
  5.         try {
  6.             $this->display($context);
  7.         } catch (Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
Twig_Template->render(array('error' => 'Could not load data for model from database. Please try again.')) in vendor/twig/twig/lib/Twig/Environment.php (line 289)
  1.      * @throws Twig_Error_Syntax  When an error occurred during compilation
  2.      * @throws Twig_Error_Runtime When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = array())
  5.     {
  6.         return $this->loadTemplate($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
Twig_Environment->render('model/videos.html.twig', array('error' => 'Could not load data for model from database. Please try again.')) in vendor/symfony/framework-bundle/Controller/ControllerTrait.php (line 225)
  1.     protected function render(string $view, array $parameters = array(), Response $response null): Response
  2.     {
  3.         if ($this->container->has('templating')) {
  4.             $content $this->container->get('templating')->render($view$parameters);
  5.         } elseif ($this->container->has('twig')) {
  6.             $content $this->container->get('twig')->render($view$parameters);
  7.         } else {
  8.             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".');
  9.         }
  10.         if (null === $response) {
Controller->render('model/videos.html.twig', array('error' => 'Could not load data for model from database. Please try again.')) in src/Controller/ModelController.php (line 463)
  1.                 $twigData['backToMale'] = $modelData['spol'] === 'male' true false;
  2.                 return $this->render('model/videos.html.twig'$twigData);
  3.             }
  4.             else {
  5.                 $twigData['error'] = 'Could not load data for model from database. Please try again.';
  6.                 return $this->render('model/videos.html.twig'$twigData);
  7.             }
  8.         }
  9.     }
  10.      /**
ModelController->modelVideo('21') in vendor/symfony/http-kernel/HttpKernel.php (line 149)
  1.         $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response = \call_user_func_array($controller$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch(KernelEvents::VIEW$event);
HttpKernel->handleRaw(object(Request), 1) in vendor/symfony/http-kernel/HttpKernel.php (line 66)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level'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) {
HttpKernel->handle(object(Request), 1, true) in vendor/symfony/http-kernel/Kernel.php (line 190)
  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(object(Request)) in public/index.php (line 37)
  1.     Request::setTrustedHosts(explode(','$trustedHosts));
  2. }
  3. $kernel = new Kernel($env$debug);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Stack Trace

Twig_Error_Runtime

Twig_Error_Runtime:
Variable "backToDevMale" does not exist.

  at templates/model/videos.html.twig:22
  at __TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389->{closure}()
     (var/cache/dev/twig/b4/b469069acb14f43ae030f37022ac9869bebbc0e87b5bb3b5780fe37060931cff.php:74)
  at __TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389->block_body(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts')))
     (vendor/twig/twig/lib/Twig/Template.php:188)
  at Twig_Template->displayBlock('body', array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts')))
     (var/cache/dev/twig/61/618ea4687aa6247b8f0d59d4a73c7b36a3508bbb4077fa9e94b269b1311266f2.php:50)
  at __TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35->doDisplay(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts')))
     (vendor/twig/twig/lib/Twig/Template.php:389)
  at Twig_Template->displayWithErrorHandling(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('title' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_stylesheets'), 'body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body'), 'javascripts' => array(object(__TwigTemplate_581f9cd92464da260f0ad9eadb6e05918a8698ef4208eef0914cca4b4634ad35), 'block_javascripts')))
     (vendor/twig/twig/lib/Twig/Template.php:366)
  at Twig_Template->display(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body')))
     (var/cache/dev/twig/b4/b469069acb14f43ae030f37022ac9869bebbc0e87b5bb3b5780fe37060931cff.php:27)
  at __TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389->doDisplay(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body')))
     (vendor/twig/twig/lib/Twig/Template.php:389)
  at Twig_Template->displayWithErrorHandling(array('error' => 'Could not load data for model from database. Please try again.', 'app' => object(AppVariable)), array('body' => array(object(__TwigTemplate_687a566e3ce263376562f4f2f3a647f670093e8a2ebed2bd510945997a5d3389), 'block_body')))
     (vendor/twig/twig/lib/Twig/Template.php:366)
  at Twig_Template->display(array('error' => 'Could not load data for model from database. Please try again.'))
     (vendor/twig/twig/lib/Twig/Template.php:374)
  at Twig_Template->render(array('error' => 'Could not load data for model from database. Please try again.'))
     (vendor/twig/twig/lib/Twig/Environment.php:289)
  at Twig_Environment->render('model/videos.html.twig', array('error' => 'Could not load data for model from database. Please try again.'))
     (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:225)
  at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('model/videos.html.twig', array('error' => 'Could not load data for model from database. Please try again.'))
     (src/Controller/ModelController.php:463)
  at App\Controller\ModelController->modelVideo('21')
     (vendor/symfony/http-kernel/HttpKernel.php:149)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:66)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:190)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:37)