From 7f13f9537c5c0766171fa28ca38a9a0039d2bcdb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Sep 2015 15:33:07 +0200 Subject: [PATCH 1/2] [WebProfilerBundle] fixed a template reference --- .../Resources/views/Profiler/toolbar_redirect.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig index b4ec407858f3d..35b6e90eb56ae 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig @@ -1,4 +1,4 @@ -{% extends 'TwigBundle::layout.html.twig' %} +{% extends '@Twig/layout.html.twig' %} {% block title 'Redirection Intercepted' %} From ff3c107f14cfc4ff4f4e2186e2ac88de83ea34f9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 28 Sep 2015 15:28:45 +0200 Subject: [PATCH 2/2] [TwigBundle] removed usage of Templating classes --- .../TwigBundle/Controller/ExceptionController.php | 10 ++++------ .../Resources/views/Exception/error.atom.twig | 2 +- .../Resources/views/Exception/error.rdf.twig | 2 +- .../Resources/views/Exception/exception.atom.twig | 2 +- .../Resources/views/Exception/exception.css.twig | 2 +- .../Resources/views/Exception/exception.html.twig | 6 +++--- .../Resources/views/Exception/exception.js.twig | 2 +- .../Resources/views/Exception/exception.rdf.twig | 2 +- .../Resources/views/Exception/exception.txt.twig | 2 +- .../Resources/views/Exception/exception.xml.twig | 2 +- .../Resources/views/Exception/exception_full.html.twig | 4 ++-- .../Resources/views/Exception/traces.html.twig | 2 +- .../Resources/views/Exception/traces.txt.twig | 2 +- .../Resources/views/Exception/traces.xml.twig | 2 +- .../Resources/views/Exception/traces_text.html.twig | 2 +- .../Tests/Controller/ExceptionControllerTest.php | 4 ++-- 16 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index b0c172c1e9e11..237fda48ec931 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 @@ protected function getAndCleanOutputBuffering($startObLevel) * @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 @@ protected function findTemplate(Request $request, $format, $code, $showException // 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 @@ protected function findTemplate(Request $request, $format, $code, $showException // 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 074389ce919e8..c27cc56e6a078 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 074389ce919e8..c27cc56e6a078 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 989740fdd01cd..d507ce46f6949 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 870d4a0fd2407..bdf242b7f1998 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 f09ffb3c658de..947df655836b8 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 %}