diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index b0c172c1e9..237fda48ec 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -11,12 +11,10 @@ namespace Symfony\Bundle\TwigBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Templating\TemplateReferenceInterface; /** * ExceptionController renders error or exception pages for a given @@ -96,7 +94,7 @@ class ExceptionController * @param int $code An HTTP response status code * @param bool $showException * - * @return TemplateReferenceInterface + * @return string */ protected function findTemplate(Request $request, $format, $code, $showException) { @@ -107,14 +105,14 @@ class ExceptionController // For error pages, try to find a template for the specific HTTP status code and format if (!$showException) { - $template = new TemplateReference('TwigBundle', 'Exception', $name.$code, $format, 'twig'); + $template = sprintf('@Twig/Exception/%s%s.%s.twig', $name, $code, $format); if ($this->templateExists($template)) { return $template; } } // try to find a template for the given format - $template = new TemplateReference('TwigBundle', 'Exception', $name, $format, 'twig'); + $template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format); if ($this->templateExists($template)) { return $template; } @@ -122,7 +120,7 @@ class ExceptionController // default to a generic HTML exception $request->setRequestFormat('html'); - return new TemplateReference('TwigBundle', 'Exception', $showException ? 'exception_full' : $name, 'html', 'twig'); + return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name); } // to be removed when the minimum required version of Twig is >= 3.0 diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig index 074389ce91..c27cc56e6a 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.atom.twig @@ -1 +1 @@ -{% include 'TwigBundle:Exception:error.xml.twig' %} +{% include '@Twig/Exception/error.xml.twig' %} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig index 074389ce91..c27cc56e6a 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/error.rdf.twig @@ -1 +1 @@ -{% include 'TwigBundle:Exception:error.xml.twig' %} +{% include '@Twig/Exception/error.xml.twig' %} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig index 989740fdd0..d507ce46f6 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.atom.twig @@ -1 +1 @@ -{% include 'TwigBundle:Exception:exception.xml.twig' with { 'exception': exception } %} +{% include '@Twig/Exception/exception.xml.twig' with { 'exception': exception } %} diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig index 870d4a0fd2..bdf242b7f1 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.css.twig @@ -1,3 +1,3 @@ /* -{% include 'TwigBundle:Exception:exception.txt.twig' with { 'exception': exception } %} +{% include '@Twig/Exception/exception.txt.twig' with { 'exception': exception } %} */ diff --git a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig index f09ffb3c65..947df65583 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig +++ b/src/Symfony/Bundle/TwigBundle/Resources/views/Exception/exception.html.twig @@ -37,7 +37,7 @@ {% for position, e in exception.toarray %} - {% include 'TwigBundle:Exception:traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %} + {% include '@Twig/Exception/traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %} {% endfor %} {% if logger %} @@ -63,7 +63,7 @@
- {% include 'TwigBundle:Exception:logs.html.twig' with { 'logs': logger.logs } only %} + {% include '@Twig/Exception/logs.html.twig' with { 'logs': logger.logs } only %}
{% endif %} @@ -88,7 +88,7 @@ {% endif %} -{% include 'TwigBundle:Exception:traces_text.html.twig' with { 'exception': exception } only %} +{% include '@Twig/Exception/traces_text.html.twig' with { 'exception': exception } only %}