* {@inheritdoc}
*/
public function render($name, array $parameters = [])
{
try {
return parent::render($name, $parameters);
} catch (Error $e) {
if ($name instanceof TemplateReference && !method_exists($e, 'setSourceContext')) {
try {
// try to get the real name of the template where the error occurred
$name = $e->getTemplateName();
* @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".');
}
$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', 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) {
//$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
* {@inheritdoc}
*/
public function render($name, array $parameters = [])
{
try {
return parent::render($name, $parameters);
} catch (Error $e) {
if ($name instanceof TemplateReference && !method_exists($e, 'setSourceContext')) {
try {
// try to get the real name of the template where the error occurred
$name = $e->getTemplateName();
* @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".');
}
$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', 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) {
//$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
[2/2] InvalidArgumentException |
---|
InvalidArgumentException: Unable to find template "app/catalog/catalog.html.twig" (looked into: /home/moovelec/home/http/app/Resources/views, /home/moovelec/home/http/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form). at vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:127 at Symfony\Bridge\Twig\TwigEngine->load('app/catalog/catalog.html.twig') (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:49) at Symfony\Bridge\Twig\TwigEngine->render('app/catalog/catalog.html.twig', array('pagination' => object(SlidingPagination))) (vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php:45) at Symfony\Bundle\TwigBundle\TwigEngine->render('app/catalog/catalog.html.twig', array('pagination' => object(SlidingPagination))) (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:284) at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('app/catalog/catalog.html.twig', array('pagination' => object(SlidingPagination))) (src/CatalogBundle/Controller/DefaultController.php:47) at CatalogBundle\Controller\DefaultController->catalogAction(object(Request)) (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:19) |
[1/2] Twig_Error_Loader |
---|
Twig_Error_Loader: Unable to find template "app/catalog/catalog.html.twig" (looked into: /home/moovelec/home/http/app/Resources/views, /home/moovelec/home/http/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form). at vendor/twig/twig/lib/Twig/Loader/Filesystem.php:234 at Twig_Loader_Filesystem->findTemplate('app/catalog/catalog.html.twig') (vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php:76) at Symfony\Bundle\TwigBundle\Loader\FilesystemLoader->findTemplate('app/catalog/catalog.html.twig') (vendor/twig/twig/lib/Twig/Loader/Filesystem.php:143) at Twig_Loader_Filesystem->getCacheKey('app/catalog/catalog.html.twig') (vendor/twig/twig/lib/Twig/Environment.php:270) at Twig_Environment->getTemplateClass('app/catalog/catalog.html.twig') (vendor/twig/twig/lib/Twig/Environment.php:350) at Twig_Environment->loadTemplate('app/catalog/catalog.html.twig') (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:125) at Symfony\Bridge\Twig\TwigEngine->load('app/catalog/catalog.html.twig') (vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:49) at Symfony\Bridge\Twig\TwigEngine->render('app/catalog/catalog.html.twig', array('pagination' => object(SlidingPagination))) (vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php:45) at Symfony\Bundle\TwigBundle\TwigEngine->render('app/catalog/catalog.html.twig', array('pagination' => object(SlidingPagination))) (vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:284) at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('app/catalog/catalog.html.twig', array('pagination' => object(SlidingPagination))) (src/CatalogBundle/Controller/DefaultController.php:47) at CatalogBundle\Controller\DefaultController->catalogAction(object(Request)) (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:19) |