浏览代码

changed templating name notation

Old notation: bundle:section:name.format:renderer (where both format and renderer are optional)
New notation: bundle:section:name.format.renderer (where only format is optional)

Valid new template names: Blog:Post:index.php, Blog:Post:index.xml.php

The new notation is more explicit and put all templating engines on the same level (there is no
more the concept of a "default" templating engine).

Even if the notation changed, the semantic has not. So, the logical template name for the above
examples is still 'index'. So, if you use a database loader for instance, the template
name is 'index' and everything else are options.

Upgrading current applications can be easily done by appending .php to each existing template
name reference (in both controllers and templates), and changing :twig to .twig for Twig templates
(for twig templates, you should also add .twig within templates themselves when referencing
another Twig templates).
Fabien Potencier 14 年之前
父节点
当前提交
a6dc10c31a
共有 21 个文件被更改,包括 150 次插入63 次删除
  1. 1 1
      src/Symfony/Bundle/FrameworkBundle/Controller/DefaultController.php
  2. 1 1
      src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php
  3. 4 4
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.php
  4. 2 2
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.xml.php
  5. 1 1
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/layout.php
  6. 1 1
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.php
  7. 1 1
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.txt.php
  8. 1 1
      src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.xml.php
  9. 17 16
      src/Symfony/Bundle/FrameworkBundle/Templating/Engine.php
  10. 87 0
      src/Symfony/Bundle/FrameworkBundle/Tests/Templating/EngineTest.php
  11. 3 3
      src/Symfony/Bundle/TwigBundle/Loader/Loader.php
  12. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php
  13. 11 10
      src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
  14. 9 9
      src/Symfony/Bundle/WebProfilerBundle/Resources/config/web_profiler.xml
  15. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/index.php
  16. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.php
  17. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/menu.php
  18. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/notfound.php
  19. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/panel.php
  20. 4 6
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php
  21. 1 1
      src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.php

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Controller/DefaultController.php

@@ -28,6 +28,6 @@ class DefaultController extends ContainerAware
      */
     public function indexAction()
     {
-        return $this->container->get('templating')->renderResponse('FrameworkBundle:Default:index');
+        return $this->container->get('templating')->renderResponse('FrameworkBundle:Default:index.php');
     }
 }

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Controller/ExceptionController.php

@@ -43,7 +43,7 @@ class ExceptionController extends ContainerAware
         }
 
         $response = $this->container->get('templating')->renderResponse(
-            'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception' : 'error'),
+            'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception.php' : 'error.php'),
             array(
                 'exception'      => new SafeDecorator($exception),
                 'logger'         => $logger,

+ 4 - 4
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.php

@@ -1,5 +1,5 @@
 <?php if (!$embedded): ?>
-    <?php $view->extend('FrameworkBundle:Exception:layout') ?>
+    <?php $view->extend('FrameworkBundle:Exception:layout.php') ?>
 <?php endif; ?>
 
 <div class="sf-exceptionreset">
@@ -27,10 +27,10 @@
         <div style="clear: both"></div>
     </div>
 
-    <?php echo $view->render('FrameworkBundle:Exception:traces', array('exception' => $exception, 'position' => 0, 'count' => $previousCount)) ?>
+    <?php echo $view->render('FrameworkBundle:Exception:traces.php', array('exception' => $exception, 'position' => 0, 'count' => $previousCount)) ?>
 
     <?php foreach ($exception->getPreviouses() as $i => $previous): ?>
-        <?php echo $view->render('FrameworkBundle:Exception:traces', array('exception' => $previous, 'position' => $i + 1, 'count' => $previousCount)) ?>
+        <?php echo $view->render('FrameworkBundle:Exception:traces.php', array('exception' => $previous, 'position' => $i + 1, 'count' => $previousCount)) ?>
     <?php endforeach; ?>
 
     <?php if (null !== $logger): ?>
@@ -43,7 +43,7 @@
             </h3>
 
             <div id="logs" style="display: none">
-                <?php echo $view->render('FrameworkBundle:Exception:logs', array('logs' => $logger->getLogs())) ?>
+                <?php echo $view->render('FrameworkBundle:Exception:logs.php', array('logs' => $logger->getLogs())) ?>
             </div>
 
         </div>

+ 2 - 2
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.xml.php

@@ -1,12 +1,12 @@
 <?php echo sprintf('<?xml version="1.0" encoding="%s" ?>', $view->getCharset())."\n" ?>
 <error code="<?php echo $exception->getStatusCode() ?>" message="<?php echo $exception->getStatusText() ?>">
     <exception class="<?php echo $exception->getClass() ?>" message="<?php echo $exception->getMessage() ?>">
-        <?php echo $view->render('FrameworkBundle:Exception:traces', array('exception' => $exception, 'position' => 0, 'count' => ($previousCount = count($exception->getPreviouses())))) ?>
+        <?php echo $view->render('FrameworkBundle:Exception:traces.php', array('exception' => $exception, 'position' => 0, 'count' => ($previousCount = count($exception->getPreviouses())))) ?>
     </exception>
 <?php if ($previousCount): ?>
 <?php foreach ($exception->getPreviouses() as $i => $previous): ?>
     <exception class="<?php echo $previous->getClass() ?>" message="<?php echo $previous->getMessage() ?>">
-        <?php echo $view->render('FrameworkBundle:Exception:traces', array('exception' => $previous, 'position' => $i + 1, 'count' => $previousCount)) ?>
+        <?php echo $view->render('FrameworkBundle:Exception:traces.php', array('exception' => $previous, 'position' => $i + 1, 'count' => $previousCount)) ?>
     </exception>
 <?php endforeach; ?>
 <?php endif; ?>

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/layout.php

@@ -8,7 +8,7 @@
             body { font: 11px Verdana, Arial, sans-serif; color: #333 }
             .sf-exceptionreset, .sf-exceptionreset .block, .sf-exceptionreset #message { margin: auto }
 
-            <?php echo $view->render('FrameworkBundle:Exception:styles') ?>
+            <?php echo $view->render('FrameworkBundle:Exception:styles.php') ?>
         </style>
         <script type="text/javascript">
             //<![CDATA[

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.php

@@ -13,7 +13,7 @@
     <ol class="traces" id="traces_<?php echo $position ?>" style="display: <?php echo 0 === $position ? 'block' : 'none' ?>">
         <?php foreach ($exception->getTrace() as $i => $trace): ?>
             <li>
-                <?php echo $view->render('FrameworkBundle:Exception:trace', array('prefix' => $position, 'i' => $i, 'trace' => $trace)) ?>
+                <?php echo $view->render('FrameworkBundle:Exception:trace.php', array('prefix' => $position, 'i' => $i, 'trace' => $trace)) ?>
             </li>
         <?php endforeach; ?>
     </ol>

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.txt.php

@@ -1,6 +1,6 @@
 <?php if (count($exception->getTrace())): ?>
 <?php foreach ($exception->getTrace() as $i => $trace): ?>
-<?php echo $view->render('FrameworkBundle:Exception:trace.txt', array('i' => $i, 'trace' => $trace)) ?>
+<?php echo $view->render('FrameworkBundle:Exception:trace.txt.php', array('i' => $i, 'trace' => $trace)) ?>
 
 <?php endforeach; ?>
 <?php endif;?>

+ 1 - 1
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/traces.xml.php

@@ -1,7 +1,7 @@
 <traces>
 <?php foreach ($exception->getTrace() as $i => $trace): ?>
         <trace>
-        <?php echo $view->render('FrameworkBundle:Exception:trace.txt', array('i' => $i, 'trace' => $trace)) ?>
+        <?php echo $view->render('FrameworkBundle:Exception:trace.txt.php', array('i' => $i, 'trace' => $trace)) ?>
 
         </trace>
 <?php endforeach; ?>

+ 17 - 16
src/Symfony/Bundle/FrameworkBundle/Templating/Engine.php

@@ -37,7 +37,7 @@ class Engine extends BaseEngine
      * @param array              $renderers An array of renderer instances
      * @param mixed              $escaper   The escaper to use (or false to disable escaping)
      */
-    public function __construct(ContainerInterface $container, LoaderInterface $loader, array $renderers = array(), $escaper)
+    public function __construct(ContainerInterface $container, LoaderInterface $loader, array $renderers = array(), $escaper = false)
     {
         $this->level = 0;
         $this->container = $container;
@@ -136,19 +136,18 @@ class Engine extends BaseEngine
         return $parameters;
     }
 
-    // Bundle:controller:action(.format)(:renderer)
+    // parses template names following the following pattern:
+    // bundle:controller:action(.format)(.renderer)
     public function splitTemplateName($name, array $defaults = array())
     {
-        $parts = explode(':', $name, 4);
-
-        if (sizeof($parts) < 3) {
+        $parts = explode(':', $name);
+        if (3 !== count($parts)) {
             throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid.', $name));
         }
 
         $options = array_replace(
             array(
-                'renderer' => 'php',
-                'format'   => '',
+                'format' => '',
             ),
             $defaults,
             array(
@@ -157,18 +156,20 @@ class Engine extends BaseEngine
             )
         );
 
-        if (false !== $pos = strpos($parts[2], '.')) {
-            $options['format'] = substr($parts[2], $pos);
-            $parts[2] = substr($parts[2], 0, $pos);
-        } else {
-            $format = $this->container->getRequestService()->getRequestFormat();
+        $elements = explode('.', $parts[2]);
+        if (3 === count($elements)) {
+            $parts[2] = $elements[0];
+            $options['format'] = $elements[1];
+            $options['renderer'] = $elements[2];
+        } elseif (2 === count($elements)) {
+            $parts[2] = $elements[0];
+            $options['renderer'] = $elements[1];
+            $format = $this->container->get('request')->getRequestFormat();
             if (null !== $format && 'html' !== $format) {
                 $options['format'] = '.'.$format;
             }
-        }
-
-        if (isset($parts[3]) && $parts[3]) {
-            $options['renderer'] = $parts[3];
+        } else {
+            throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid.', $name));
         }
 
         return array($parts[2], $options);

+ 87 - 0
src/Symfony/Bundle/FrameworkBundle/Tests/Templating/EngineTest.php

@@ -0,0 +1,87 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\FrameworkBundle\Tests\Templating;
+
+use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
+use Symfony\Bundle\FrameworkBundle\Templating\Engine;
+
+class EngineTest extends TestCase
+{
+    /**
+     * @dataProvider getSplitTemplateNameTests
+     */
+    public function testSplitTemplateName($name, $parameters)
+    {
+        $engine = new Engine($this->getContainerMock(), $this->getLoaderMock());
+
+        $this->assertEquals($parameters, $engine->splitTemplateName($name));
+    }
+
+    public function getSplitTemplateNameTests()
+    {
+        return array(
+            array('BlogBundle:Post:index.php', array('index', array('bundle' => 'BlogBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => ''))),
+            array('BlogBundle:Post:index.twig', array('index', array('bundle' => 'BlogBundle', 'controller' => 'Post', 'renderer' => 'twig', 'format' => ''))),
+            array('BlogBundle:Post:index.xml.php', array('index', array('bundle' => 'BlogBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'xml'))),
+        );
+    }
+
+    /**
+     * @dataProvider      getSplitTemplateNameInvalidTests
+     * @expectedException \InvalidArgumentException
+     */
+    public function testSplitTemplateNameInvalid($name)
+    {
+        $engine = new Engine($this->getContainerMock(), $this->getLoaderMock());
+
+        $engine->splitTemplateName($name);
+    }
+
+    public function getSplitTemplateNameInvalidTests()
+    {
+        return array(
+            array('BlogBundle:Post:index'),
+            array('BlogBundle:Post'),
+            array('BlogBundle:Post:foo:bar'),
+            array('BlogBundle:Post:index.foo.bar.foobar'),
+        );
+    }
+
+    protected function getContainerMock()
+    {
+        $request = $this->getMock('Symfony\Component\HttpFoundation\Request');
+        $request
+            ->expects($this->any())
+            ->method('getRequestFormat')
+            ->will($this->returnValue('html'))
+        ;
+
+        $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
+        $container
+            ->expects($this->exactly(2))
+            ->method('findTaggedServiceIds')
+            ->will($this->returnValue(array()))
+        ;
+        $container
+            ->expects($this->any())
+            ->method('get')
+            ->will($this->returnValue($request))
+        ;
+
+        return $container;
+    }
+
+    protected function getLoaderMock()
+    {
+        return $this->getMock('Symfony\Component\Templating\Loader\LoaderInterface');
+    }
+}

+ 3 - 3
src/Symfony/Bundle/TwigBundle/Loader/Loader.php

@@ -41,7 +41,7 @@ class Loader implements \Twig_LoaderInterface
             return $name->getContent();
         }
 
-        list($name, $options) = $this->engine->splitTemplateName($name, array('renderer' => 'twig'));
+        list($name, $options) = $this->engine->splitTemplateName($name);
 
         $template = $this->engine->getLoader()->load($name, $options);
 
@@ -65,7 +65,7 @@ class Loader implements \Twig_LoaderInterface
             return (string) $name;
         }
 
-        list($name, $options) = $this->engine->splitTemplateName($name, array('renderer' => 'twig'));
+        list($name, $options) = $this->engine->splitTemplateName($name);
 
         return $name.'_'.serialize($options);
     }
@@ -86,7 +86,7 @@ class Loader implements \Twig_LoaderInterface
             return false;
         }
 
-        list($name, $options) = $this->engine->splitTemplateName($name, array('renderer' => 'twig'));
+        list($name, $options) = $this->engine->splitTemplateName($name);
 
         return $this->engine->getLoader()->isFresh($name, $options, $time);
     }

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php

@@ -32,7 +32,7 @@ class ExceptionController extends ContainerAware
     public function showAction(FlattenException $exception, $format)
     {
         return $this->container->get('templating')->renderResponse(
-            'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception' : 'error'),
+            'FrameworkBundle:Exception:'.($this->container->get('kernel')->isDebug() ? 'exception.php' : 'error.php'),
             array(
                 'exception'      => new SafeDecorator($exception),
                 'logger'         => null,

+ 11 - 10
src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

@@ -37,11 +37,11 @@ class ProfilerController extends ContainerAware
         $profiler = $this->container->get('profiler')->loadFromToken($token);
 
         if ($profiler->isEmpty()) {
-            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:notfound', array(
+            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:notfound.php', array(
                 'token'     => $token,
             ));
         } else {
-            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:index', array(
+            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:index.php', array(
                 'token'     => $token,
                 'profiler'  => new SafeDecorator($profiler),
                 'collector' => $profiler->get('request'),
@@ -145,7 +145,7 @@ class ProfilerController extends ContainerAware
             $position = false === strpos($this->container->get('request')->headers->get('user-agent'), 'Mobile') ? 'fixed' : 'absolute';
         }
 
-        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:toolbar', array(
+        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:toolbar.php', array(
             'position'  => $position,
             'profiler'  => new SafeDecorator($profiler),
             'templates' => $this->getTemplates($profiler, '_bar'),
@@ -169,11 +169,11 @@ class ProfilerController extends ContainerAware
         }
 
         if ($profiler->isEmpty()) {
-            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:notfound', array(
+            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:notfound.php', array(
                 'token'     => $token,
             ));
         } else {
-            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:panel', array(
+            return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:panel.php', array(
                 'token'     => $token,
                 'profiler'  => new SafeDecorator($profiler),
                 'collector' => new SafeDecorator($profiler->get($panel)),
@@ -195,7 +195,7 @@ class ProfilerController extends ContainerAware
     {
         $profiler = $this->container->get('profiler')->loadFromToken($token);
 
-        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:menu', array(
+        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:menu.php', array(
             'token'     => $token,
             'profiler'  => new SafeDecorator($profiler),
             'templates' => $this->getTemplates($profiler, '_menu'),
@@ -218,7 +218,7 @@ class ProfilerController extends ContainerAware
         $url = $session->get('_profiler_search_url');
         $limit = $session->get('_profiler_search_limit');
 
-        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:search', array(
+        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:search.php', array(
             'token'    => $token,
             'profiler' => new SafeDecorator($profiler),
             'tokens'   => $profiler->find($ip, $url, 10),
@@ -243,7 +243,7 @@ class ProfilerController extends ContainerAware
         $url = $session->get('_profiler_search_url');
         $limit = $session->get('_profiler_search_limit');
 
-        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:results', array(
+        return $this->container->get('templating')->renderResponse('WebProfilerBundle:Profiler:results.php', array(
             'token'    => $token,
             'profiler' => new SafeDecorator($this->container->get('profiler')->loadFromToken($token)),
             'tokens'   => $profiler->find($ip, $url, 10),
@@ -293,11 +293,12 @@ class ProfilerController extends ContainerAware
         $templates = array();
         foreach ($this->container->getParameter('data_collector.templates') as $name => $template) {
             if ($profiler->has($name)) {
-                if (!$this->container->get('templating')->exists($template.$suffix)) {
+                $tpl = preg_replace('/\.(.+?)$/', $suffix.'.$1', $template);
+                if (!$this->container->get('templating')->exists($tpl)) {
                     continue;
                 }
 
-                $templates[$name] = $template.$suffix;
+                $templates[$name] = $tpl;
             }
         }
 

+ 9 - 9
src/Symfony/Bundle/WebProfilerBundle/Resources/config/web_profiler.xml

@@ -6,15 +6,15 @@
 
     <parameters>
         <parameter key="data_collector.templates" type="collection">
-            <parameter key="config">WebProfilerBundle:Profiler:config</parameter>
-            <parameter key="request">WebProfilerBundle:Profiler:request</parameter>
-            <parameter key="exception">WebProfilerBundle:Profiler:exception</parameter>
-            <parameter key="events">WebProfilerBundle:Profiler:events</parameter>
-            <parameter key="logger">WebProfilerBundle:Profiler:logger</parameter>
-            <parameter key="timer">WebProfilerBundle:Profiler:timer</parameter>
-            <parameter key="memory">WebProfilerBundle:Profiler:memory</parameter>
-            <parameter key="db">DoctrineBundle:Profiler:db</parameter>
-            <parameter key="mongodb">DoctrineMongoDBBundle:Profiler:mongodb</parameter>
+            <parameter key="config">WebProfilerBundle:Profiler:config.php</parameter>
+            <parameter key="request">WebProfilerBundle:Profiler:request.php</parameter>
+            <parameter key="exception">WebProfilerBundle:Profiler:exception.php</parameter>
+            <parameter key="events">WebProfilerBundle:Profiler:events.php</parameter>
+            <parameter key="logger">WebProfilerBundle:Profiler:logger.php</parameter>
+            <parameter key="timer">WebProfilerBundle:Profiler:timer.php</parameter>
+            <parameter key="memory">WebProfilerBundle:Profiler:memory.php</parameter>
+            <parameter key="db">DoctrineBundle:Profiler:db.php</parameter>
+            <parameter key="mongodb">DoctrineMongoDBBundle:Profiler:mongodb.php</parameter>
         </parameter>
     </parameters>
 </container>

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/index.php

@@ -1,3 +1,3 @@
-<?php $view->extend('WebProfilerBundle:Profiler:layout') ?>
+<?php $view->extend('WebProfilerBundle:Profiler:layout.php') ?>
 
 <?php echo $view->render($template, array('data' => $collector)) ?>

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.php

@@ -1,4 +1,4 @@
-<?php $view->extend('WebProfilerBundle:Profiler:base') ?>
+<?php $view->extend('WebProfilerBundle:Profiler:base.php') ?>
 
 <div class="header">
     <h1>

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/menu.php

@@ -12,4 +12,4 @@
 
 <?php echo $view->get('actions')->render('WebProfilerBundle:Profiler:menu', array('token' => $token)) ?>
 
-<?php echo $view->render('WebProfilerBundle:Profiler:admin', array('token' => $token)) ?>
+<?php echo $view->render('WebProfilerBundle:Profiler:admin.php', array('token' => $token)) ?>

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/notfound.php

@@ -1,4 +1,4 @@
-<?php $view->extend('WebProfilerBundle:Profiler:base') ?>
+<?php $view->extend('WebProfilerBundle:Profiler:base.php') ?>
 
 <div class="header">
     <h1>

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/panel.php

@@ -1,3 +1,3 @@
-<?php $view->extend('WebProfilerBundle:Profiler:layout') ?>
+<?php $view->extend('WebProfilerBundle:Profiler:layout.php') ?>
 
 <?php echo $view->render($template, array('data' => $collector)) ?>

+ 4 - 6
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/request_panel.php

@@ -17,22 +17,22 @@
 <h2>Request Cookies</h2>
 
 <?php if (count($data->getRequestCookies()->all())): ?>
-    <?php echo $view->render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestCookies())) ?>
+    <?php echo $view->render('WebProfilerBundle:Profiler:bag.php', array('bag' => $data->getRequestCookies())) ?>
 <?php else: ?>
     <em>No cookies</em>
 <?php endif; ?>
 
 <h2>Requests Headers</h2>
 
-<?php echo $view->render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestHeaders())) ?>
+<?php echo $view->render('WebProfilerBundle:Profiler:bag.php', array('bag' => $data->getRequestHeaders())) ?>
 
 <h2>Requests Server Parameters</h2>
 
-<?php echo $view->render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getRequestServer())) ?>
+<?php echo $view->render('WebProfilerBundle:Profiler:bag.php', array('bag' => $data->getRequestServer())) ?>
 
 <h2>Response Headers</h2>
 
-<?php echo $view->render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getResponseHeaders())) ?>
+<?php echo $view->render('WebProfilerBundle:Profiler:bag.php', array('bag' => $data->getResponseHeaders())) ?>
 
 <h2>Response Session Attributes</h2>
 
@@ -59,5 +59,3 @@
         </tr>
     <?php endforeach; ?>
 </table>
-
-<?php //echo $view->render('WebProfilerBundle:Profiler:bag', array('bag' => $data->getSessionAttributes())) ?>

+ 1 - 1
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/results.php

@@ -1,4 +1,4 @@
-<?php $view->extend('WebProfilerBundle:Profiler:layout') ?>
+<?php $view->extend('WebProfilerBundle:Profiler:layout.php') ?>
 
 <h2>Search Results</h2>