* @final since version 3.4
*/
protected function render($view, array $parameters = [], Response $response = null)
{
if ($this->container->has('templating')) {
$content = $this->container->get('templating')->render($view, $parameters);
} elseif ($this->container->has('twig')) {
$content = $this->container->get('twig')->render($view, $parameters);
} else {
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".');
}
if($product->isDeleted()) return ($category instanceOf Category && !$category->isDeleted()) ? $this->redirectToRoute('product_list', ['id'=>$category->isDeleted(), 'slug'=>$category->translate()->getSlug()]) : $this->redirectToRoute('homepage');
$attributes_all = $this->getAttributes($request, $product);
$attributes = $attributes_all[0];
$attributes_items = $attributes_all[1];
return $this->render('app/catalog/show.html.twig', ['category' => $category, 'product' => $product, "attributes" => $attributes, "attributes_items" => $attributes_items,]);
}
private function getAttributes($request, $entity)
{
/** @var Product $product */
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = \call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
* @final since version 3.4
*/
protected function render($view, array $parameters = [], Response $response = null)
{
if ($this->container->has('templating')) {
$content = $this->container->get('templating')->render($view, $parameters);
} elseif ($this->container->has('twig')) {
$content = $this->container->get('twig')->render($view, $parameters);
} else {
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".');
}
if($product->isDeleted()) return ($category instanceOf Category && !$category->isDeleted()) ? $this->redirectToRoute('product_list', ['id'=>$category->isDeleted(), 'slug'=>$category->translate()->getSlug()]) : $this->redirectToRoute('homepage');
$attributes_all = $this->getAttributes($request, $product);
$attributes = $attributes_all[0];
$attributes_items = $attributes_all[1];
return $this->render('app/catalog/show.html.twig', ['category' => $category, 'product' => $product, "attributes" => $attributes, "attributes_items" => $attributes_items,]);
}
private function getAttributes($request, $entity)
{
/** @var Product $product */
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = \call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
No log messages
[2/2] InvalidArgumentException |
---|
InvalidArgumentException: Unable to find template "app/catalog/show.html.twig" (looked into: /home/website/symfony/app/Resources/views, /home/website/symfony/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form). at vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:133 at Symfony\Bridge\Twig\TwigEngine->load('app/catalog/show.html.twig') (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:50) at Symfony\Bridge\Twig\TwigEngine->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:286) at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) (src/CatalogBundle/Controller/DefaultController.php:111) at CatalogBundle\Controller\DefaultController->showAction(object(Request), object(Category), object(Product)) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (web/app.php:23) |
[1/2] LoaderError |
---|
Twig\Error\LoaderError: Unable to find template "app/catalog/show.html.twig" (looked into: /home/website/symfony/app/Resources/views, /home/website/symfony/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form). at vendor/twig/twig/src/Loader/FilesystemLoader.php:250 at Twig\Loader\FilesystemLoader->findTemplate('app/catalog/show.html.twig') (vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php:76) at Symfony\Bundle\TwigBundle\Loader\FilesystemLoader->findTemplate('app/catalog/show.html.twig') (vendor/twig/twig/src/Loader/FilesystemLoader.php:150) at Twig\Loader\FilesystemLoader->getCacheKey('app/catalog/show.html.twig') (vendor/twig/twig/src/Environment.php:299) at Twig\Environment->getTemplateClass('app/catalog/show.html.twig') (vendor/twig/twig/src/Environment.php:381) at Twig\Environment->loadTemplate('app/catalog/show.html.twig') (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:131) at Symfony\Bridge\Twig\TwigEngine->load('app/catalog/show.html.twig') (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:50) at Symfony\Bridge\Twig\TwigEngine->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:286) at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('app/catalog/show.html.twig', array('category' => object(Category), 'product' => object(Product), 'attributes' => array(), 'attributes_items' => array())) (src/CatalogBundle/Controller/DefaultController.php:111) at CatalogBundle\Controller\DefaultController->showAction(object(Request), object(Category), object(Product)) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (web/app.php:23) |