http://www.dutoner.ell.mademonstration.fr/fr_FR/

Exceptions

An exception has been thrown during the rendering of a template ("Parameter "slug" for route "sylius_shop_product_index" must match ".+(?<!/)" ("" given) to generate a corresponding URL.").

  • Exceptions 2
  • Logs
  • Stack Traces 2

Twig\Error\ RuntimeError

  1.                     {{ macros.item(childTaxon) }}
  2.                 {% endfor %}
  3.             </div>
  4.         </div>
  5.     {% else %}
  6.         <a href="{{ path('sylius_shop_product_index', {'slug': taxon.slug, '_locale': taxon.translation.locale}) }}" class="item" {{ sylius_test_html_attribute('menu-item') }}>{{ taxon.name }}</a>
  7.     {% endif %}
  8. {% endmacro %}
  9. {% import _self as macros %}
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context\func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.         if ($this->container->has('templating')) {
  2.             @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);
  3.             $content $this->container->get('templating')->render($view$parameters);
  4.         } elseif ($this->container->has('twig')) {
  5.             $content $this->container->get('twig')->render($view$parameters);
  6.         } else {
  7.             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".');
  8.         }
  9.         if (null === $response) {
  1.         if ($configuration->isHtmlRequest()) {
  2.             return $this->render($configuration->getTemplate(ResourceActions::INDEX '.html'), [
  3.                 'configuration' => $configuration,
  4.                 'metadata' => $this->metadata,
  5.                 'resources' => $resources,
  6.                 $this->metadata->getPluralName() => $resources,
  7.             ]);
  8.         }
  9.         return $this->createRestView($configuration$resources);
  10.     }
  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 $requestint $type HttpKernelInterface::MAIN_REQUESTbool $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.         if (!IpUtils::checkIp('127.0.0.1'$trustedProxies)) {
  2.             Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3.         }
  4.         try {
  5.             return $kernel->handle($request$type$catch);
  6.         } finally {
  7.             // restore global state
  8.             Request::setTrustedProxies($trustedProxies$trustedHeaderSet);
  9.         }
  10.     }
  1.             $subRequest->attributes->add($reference->attributes);
  2.         }
  3.         $level ob_get_level();
  4.         try {
  5.             return SubRequestHandler::handle($this->kernel$subRequestHttpKernelInterface::SUB_REQUESTfalse);
  6.         } catch (\Exception $e) {
  7.             // we dispatch the exception event to trigger the logging
  8.             // the response that comes back is ignored
  9.             if (isset($options['ignore_errors']) && $options['ignore_errors'] && $this->dispatcher) {
  10.                 $event = new ExceptionEvent($this->kernel$requestHttpKernelInterface::SUB_REQUEST$e);
  1.         if (!$request $this->requestStack->getCurrentRequest()) {
  2.             throw new \LogicException('Rendering a fragment can only be done when handling a Request.');
  3.         }
  4.         return $this->deliver($this->renderers[$renderer]->render($uri$request$options));
  5.     }
  6.     /**
  7.      * Delivers the Response as a string.
  8.      *
  1.         if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) {
  2.             $this->addRenderer($this->container->get($renderer));
  3.             $this->initialized[$renderer] = true;
  4.         }
  5.         return parent::render($uri$renderer$options);
  6.     }
  7. }
  1.     public function renderFragment($uri, array $options = []): string
  2.     {
  3.         $strategy $options['strategy'] ?? 'inline';
  4.         unset($options['strategy']);
  5.         return $this->handler->render($uri$strategy$options);
  6.     }
  7.     /**
  8.      * Renders a fragment.
  9.      *
  1.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  2.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Layout/Header/_menu.html.twig"));
  3.         // line 1
  4.         echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sylius_shop_partial_channel_menu_taxon_index", ["template" => "@SyliusShop/Taxon/_horizontalMenu.html.twig"]));
  5.         echo "
  6. ";
  7.         
  8.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context\func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     public function render(TemplateBlock $templateBlock, array $context = []): string
  2.     {
  3.         return $this->twig->render(
  4.             $templateBlock->getTemplate(),
  5.             array_replace($templateBlock->getContext(), $context)
  6.         );
  7.     }
  8. }
  1.     public function render(TemplateBlock $templateBlock, array $context = []): string
  2.     {
  3.         $this->templateBlockRenderingHistory->startRenderingBlock($templateBlock$context);
  4.         $renderedBlock $this->templateBlockRenderer->render($templateBlock$context);
  5.         $this->templateBlockRenderingHistory->stopRenderingBlock($templateBlock$context);
  6.         return $renderedBlock;
  7.     }
  1.                 $templateBlock->getTemplate(),
  2.                 $templateBlock->getPriority()
  3.             );
  4.         }
  5.         $renderedParts[] = $this->templateBlockRenderer->render($templateBlock$context);
  6.         if ($shouldRenderHtmlDebug) {
  7.             $renderedParts[] = sprintf(
  8.                 '<!-- END BLOCK | event name: "%s", block name: "%s" -->',
  9.                 $templateBlock->getEventName(),
  1.     {
  2.         $templateBlocks $this->templateBlockRegistry->findEnabledForEvents($eventNames);
  3.         $renderedTemplates = [];
  4.         foreach ($templateBlocks as $templateBlock) {
  5.             $renderedTemplates[] = $this->templateBlockRenderer->render($templateBlock$context);
  6.         }
  7.         return implode("\n"$renderedTemplates);
  8.     }
  9. }
  1.     public function render(array $eventNames, array $context = []): string
  2.     {
  3.         $this->templateBlockRenderingHistory->startRenderingEvent($eventNames$context);
  4.         $renderedEvent $this->templateEventRenderer->render($eventNames$context);
  5.         $this->templateBlockRenderingHistory->stopRenderingEvent($eventNames$context);
  6.         return $renderedEvent;
  7.     }
  1.                 '<!-- BEGIN EVENT | event name: "%s" -->',
  2.                 implode(', '$eventNames)
  3.             );
  4.         }
  5.         $renderedParts[] = $this->templateEventRenderer->render($eventNames$context);
  6.         if ($shouldRenderHtmlDebug) {
  7.             $renderedParts[] = sprintf(
  8.                 '<!-- END EVENT | event name: "%s" -->',
  9.                 implode(', '$eventNames)
  1.     /**
  2.      * @param string|string[] $eventName
  3.      */
  4.     public function render(string|array $eventName, array $context = []): string
  5.     {
  6.         return $this->templateEventRenderer->render((array) $eventName$context);
  7.     }
  8. }
  1.         // line 33
  2.         echo "            <header>
  3.                 ";
  4.         // line 34
  5.         echo $this->extensions['Sylius\Bundle\UiBundle\Twig\TemplateEventExtension']->render("sylius.shop.layout.header");
  6.         echo "
  7.             </header>
  8.         ";
  9.         
  10.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  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 (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
  1.         // line 30
  2.         echo "
  3.     <div class=\"ui container\">
  4.         ";
  5.         // line 32
  6.         $this->displayBlock('header'$context$blocks);
  7.         // line 37
  8.         echo "
  9.         ";
  10.         // line 38
  11.         $this->loadTemplate("@SyliusShop/_flashes.html.twig""@SyliusShop/layout.html.twig"38)->display($context);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  2.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Homepage/index.html.twig"));
  3.         $this->parent $this->loadTemplate("@SyliusShop/layout.html.twig""@SyliusShop/Homepage/index.html.twig"1);
  4.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  5.         
  6.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  7.         
  8.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context\func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     {
  2.     }
  3.     public function indexAction(Request $request): Response
  4.     {
  5.         return new Response($this->templatingEngine->render('@SyliusShop/Homepage/index.html.twig'));
  6.     }
  7. }
  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 $requestint $type HttpKernelInterface::MAIN_REQUESTbool $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 27)
  1.     Request::setTrustedHosts([$trustedHosts]);
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Symfony\Component\Routing\Exception\ InvalidParameterException

Parameter "slug" for route "sylius_shop_product_index" must match ".+(?<!/)" ("" given) to generate a corresponding URL.

  1.                 if (!$optional || $important || !\array_key_exists($varName$defaults) || (null !== $mergedParams[$varName] && (string) $mergedParams[$varName] !== (string) $defaults[$varName])) {
  2.                     // check requirement (while ignoring look-around patterns)
  3.                     if (null !== $this->strictRequirements && !preg_match('#^'.preg_replace('/\(\?(?:=|<=|!|<!)((?:[^()\\\\]+|\\\\.|\((?1)\))*)\)/'''$token[2]).'$#i'.(empty($token[4]) ? '' 'u'), $mergedParams[$token[3]] ?? '')) {
  4.                         if ($this->strictRequirements) {
  5.                             throw new InvalidParameterException(strtr($message, ['{parameter}' => $varName'{route}' => $name'{expected}' => $token[2], '{given}' => $mergedParams[$varName]]));
  6.                         }
  7.                         if ($this->logger) {
  8.                             $this->logger->error($message, ['parameter' => $varName'route' => $name'expected' => $token[2], 'given' => $mergedParams[$varName]]);
  9.                         }
  1.             } elseif (!isset($parameters['_locale'])) {
  2.                 $parameters['_locale'] = $defaults['_locale'];
  3.             }
  4.         }
  5.         return $this->doGenerate($variables$defaults$requirements$tokens$parameters$name$referenceType$hostTokens$requiredSchemes);
  6.     }
  7. }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function generate(string $name, array $parameters = [], int $referenceType self::ABSOLUTE_PATH)
  5.     {
  6.         return $this->getGenerator()->generate($name$parameters$referenceType);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      */
  1.         ];
  2.     }
  3.     public function getPath(string $name, array $parameters = [], bool $relative false): string
  4.     {
  5.         return $this->generator->generate($name$parameters$relative UrlGeneratorInterface::RELATIVE_PATH UrlGeneratorInterface::ABSOLUTE_PATH);
  6.     }
  7.     public function getUrl(string $name, array $parameters = [], bool $schemeRelative false): string
  8.     {
  9.         return $this->generator->generate($name$parameters$schemeRelative UrlGeneratorInterface::NETWORK_PATH UrlGeneratorInterface::ABSOLUTE_URL);
  1.         </div>
  2.     ";
  3.             } else {
  4.                 // line 15
  5.                 echo "        <a href=\"";
  6.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("sylius_shop_product_index", ["slug" => twig_get_attribute($this->env$this->source, (isset($context["taxon"]) || array_key_exists("taxon"$context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.'15$this->source); })()), "slug", [], "any"falsefalsefalse15), "_locale" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["taxon"]) || array_key_exists("taxon"$context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.'15$this->source); })()), "translation", [], "any"falsefalsefalse15), "locale", [], "any"falsefalsefalse15)]), "html"nulltrue);
  7.                 echo "\" class=\"item\" ";
  8.                 echo call_user_func_array($this->env->getFunction('sylius_test_html_attribute')->getCallable(), ["menu-item"]);
  9.                 echo ">";
  10.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["taxon"]) || array_key_exists("taxon"$context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.'15$this->source); })()), "name", [], "any"falsefalsefalse15), "html"nulltrue);
  11.                 echo "</a>
  1.         }
  2.         throw new RuntimeError(sprintf('Macro "%s" is not defined in template "%s".'substr($method\strlen('macro_')), $template->getTemplateName()), $lineno$source);
  3.     }
  4.     return $template->$method(...$args);
  5. }
  6. /**
  7.  * @internal
  8.  */
  1.                 $context['_parent'] = $context;
  2.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["taxon"]) || array_key_exists("taxon"$context) ? $context["taxon"] : (function () { throw new RuntimeError('Variable "taxon" does not exist.'9$this->source); })()), "enabledChildren", [], "any"falsefalsefalse9));
  3.                 foreach ($context['_seq'] as $context["_key"] => $context["childTaxon"]) {
  4.                     // line 10
  5.                     echo "                    ";
  6.                     echo twig_call_macro($macros["macros"], "macro_item", [$context["childTaxon"]], 10$context$this->getSourceContext());
  7.                     echo "
  8.                 ";
  9.                 }
  10.                 $_parent $context['_parent'];
  11.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['childTaxon'], $context['_parent'], $context['loop']);
  1.         }
  2.         throw new RuntimeError(sprintf('Macro "%s" is not defined in template "%s".'substr($method\strlen('macro_')), $template->getTemplateName()), $lineno$source);
  3.     }
  4.     return $template->$method(...$args);
  5. }
  6. /**
  7.  * @internal
  8.  */
  1.             $context['_parent'] = $context;
  2.             $context['_seq'] = twig_ensure_traversable((isset($context["taxons"]) || array_key_exists("taxons"$context) ? $context["taxons"] : (function () { throw new RuntimeError('Variable "taxons" does not exist.'23$this->source); })()));
  3.             foreach ($context['_seq'] as $context["_key"] => $context["taxon"]) {
  4.                 // line 24
  5.                 echo "        ";
  6.                 echo twig_call_macro($macros["macros"], "macro_item", [$context["taxon"]], 24$context$this->getSourceContext());
  7.                 echo "
  8.     ";
  9.             }
  10.             $_parent $context['_parent'];
  11.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['taxon'], $context['_parent'], $context['loop']);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context\func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.         if ($this->container->has('templating')) {
  2.             @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);
  3.             $content $this->container->get('templating')->render($view$parameters);
  4.         } elseif ($this->container->has('twig')) {
  5.             $content $this->container->get('twig')->render($view$parameters);
  6.         } else {
  7.             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".');
  8.         }
  9.         if (null === $response) {
  1.         if ($configuration->isHtmlRequest()) {
  2.             return $this->render($configuration->getTemplate(ResourceActions::INDEX '.html'), [
  3.                 'configuration' => $configuration,
  4.                 'metadata' => $this->metadata,
  5.                 'resources' => $resources,
  6.                 $this->metadata->getPluralName() => $resources,
  7.             ]);
  8.         }
  9.         return $this->createRestView($configuration$resources);
  10.     }
  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 $requestint $type HttpKernelInterface::MAIN_REQUESTbool $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.         if (!IpUtils::checkIp('127.0.0.1'$trustedProxies)) {
  2.             Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3.         }
  4.         try {
  5.             return $kernel->handle($request$type$catch);
  6.         } finally {
  7.             // restore global state
  8.             Request::setTrustedProxies($trustedProxies$trustedHeaderSet);
  9.         }
  10.     }
  1.             $subRequest->attributes->add($reference->attributes);
  2.         }
  3.         $level ob_get_level();
  4.         try {
  5.             return SubRequestHandler::handle($this->kernel$subRequestHttpKernelInterface::SUB_REQUESTfalse);
  6.         } catch (\Exception $e) {
  7.             // we dispatch the exception event to trigger the logging
  8.             // the response that comes back is ignored
  9.             if (isset($options['ignore_errors']) && $options['ignore_errors'] && $this->dispatcher) {
  10.                 $event = new ExceptionEvent($this->kernel$requestHttpKernelInterface::SUB_REQUEST$e);
  1.         if (!$request $this->requestStack->getCurrentRequest()) {
  2.             throw new \LogicException('Rendering a fragment can only be done when handling a Request.');
  3.         }
  4.         return $this->deliver($this->renderers[$renderer]->render($uri$request$options));
  5.     }
  6.     /**
  7.      * Delivers the Response as a string.
  8.      *
  1.         if (!isset($this->initialized[$renderer]) && $this->container->has($renderer)) {
  2.             $this->addRenderer($this->container->get($renderer));
  3.             $this->initialized[$renderer] = true;
  4.         }
  5.         return parent::render($uri$renderer$options);
  6.     }
  7. }
  1.     public function renderFragment($uri, array $options = []): string
  2.     {
  3.         $strategy $options['strategy'] ?? 'inline';
  4.         unset($options['strategy']);
  5.         return $this->handler->render($uri$strategy$options);
  6.     }
  7.     /**
  8.      * Renders a fragment.
  9.      *
  1.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  2.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Layout/Header/_menu.html.twig"));
  3.         // line 1
  4.         echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("sylius_shop_partial_channel_menu_taxon_index", ["template" => "@SyliusShop/Taxon/_horizontalMenu.html.twig"]));
  5.         echo "
  6. ";
  7.         
  8.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context\func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     public function render(TemplateBlock $templateBlock, array $context = []): string
  2.     {
  3.         return $this->twig->render(
  4.             $templateBlock->getTemplate(),
  5.             array_replace($templateBlock->getContext(), $context)
  6.         );
  7.     }
  8. }
  1.     public function render(TemplateBlock $templateBlock, array $context = []): string
  2.     {
  3.         $this->templateBlockRenderingHistory->startRenderingBlock($templateBlock$context);
  4.         $renderedBlock $this->templateBlockRenderer->render($templateBlock$context);
  5.         $this->templateBlockRenderingHistory->stopRenderingBlock($templateBlock$context);
  6.         return $renderedBlock;
  7.     }
  1.                 $templateBlock->getTemplate(),
  2.                 $templateBlock->getPriority()
  3.             );
  4.         }
  5.         $renderedParts[] = $this->templateBlockRenderer->render($templateBlock$context);
  6.         if ($shouldRenderHtmlDebug) {
  7.             $renderedParts[] = sprintf(
  8.                 '<!-- END BLOCK | event name: "%s", block name: "%s" -->',
  9.                 $templateBlock->getEventName(),
  1.     {
  2.         $templateBlocks $this->templateBlockRegistry->findEnabledForEvents($eventNames);
  3.         $renderedTemplates = [];
  4.         foreach ($templateBlocks as $templateBlock) {
  5.             $renderedTemplates[] = $this->templateBlockRenderer->render($templateBlock$context);
  6.         }
  7.         return implode("\n"$renderedTemplates);
  8.     }
  9. }
  1.     public function render(array $eventNames, array $context = []): string
  2.     {
  3.         $this->templateBlockRenderingHistory->startRenderingEvent($eventNames$context);
  4.         $renderedEvent $this->templateEventRenderer->render($eventNames$context);
  5.         $this->templateBlockRenderingHistory->stopRenderingEvent($eventNames$context);
  6.         return $renderedEvent;
  7.     }
  1.                 '<!-- BEGIN EVENT | event name: "%s" -->',
  2.                 implode(', '$eventNames)
  3.             );
  4.         }
  5.         $renderedParts[] = $this->templateEventRenderer->render($eventNames$context);
  6.         if ($shouldRenderHtmlDebug) {
  7.             $renderedParts[] = sprintf(
  8.                 '<!-- END EVENT | event name: "%s" -->',
  9.                 implode(', '$eventNames)
  1.     /**
  2.      * @param string|string[] $eventName
  3.      */
  4.     public function render(string|array $eventName, array $context = []): string
  5.     {
  6.         return $this->templateEventRenderer->render((array) $eventName$context);
  7.     }
  8. }
  1.         // line 33
  2.         echo "            <header>
  3.                 ";
  4.         // line 34
  5.         echo $this->extensions['Sylius\Bundle\UiBundle\Twig\TemplateEventExtension']->render("sylius.shop.layout.header");
  6.         echo "
  7.             </header>
  8.         ";
  9.         
  10.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  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 (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
  1.         // line 30
  2.         echo "
  3.     <div class=\"ui container\">
  4.         ";
  5.         // line 32
  6.         $this->displayBlock('header'$context$blocks);
  7.         // line 37
  8.         echo "
  9.         ";
  10.         // line 38
  11.         $this->loadTemplate("@SyliusShop/_flashes.html.twig""@SyliusShop/layout.html.twig"38)->display($context);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  2.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@SyliusShop/Homepage/index.html.twig"));
  3.         $this->parent $this->loadTemplate("@SyliusShop/layout.html.twig""@SyliusShop/Homepage/index.html.twig"1);
  4.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  5.         
  6.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  7.         
  8.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  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();
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.      */
  2.     public function render(array $context = []): string
  3.     {
  4.         // using func_get_args() allows to not expose the blocks argument
  5.         // as it should only be used by internal code
  6.         return $this->template->render($context\func_get_args()[1] ?? []);
  7.     }
  8.     /**
  9.      * Displays the template.
  10.      *
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = [])
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     {
  2.     }
  3.     public function indexAction(Request $request): Response
  4.     {
  5.         return new Response($this->templatingEngine->render('@SyliusShop/Homepage/index.html.twig'));
  6.     }
  7. }
  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 $requestint $type HttpKernelInterface::MAIN_REQUESTbool $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 27)
  1.     Request::setTrustedHosts([$trustedHosts]);
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);