Skip to content

Commit

Permalink
Improved the explanation thanks to @stof comments
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Sep 13, 2014
1 parent 3828162 commit 5e47417
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,28 @@ shortcut to render the default ``AcmeHelloBundle:Hello:index.html.php`` template
.. caution::

Enabling the ``php`` and ``twig`` template engines simultaneously is
allowed but it will produce an important side effect in your application:
template namespaces will no longer work::
allowed but it will produce an undesirable side effect in your application.
Template namespaces will no longer work except inside Twig templates::

public function indexAction()
{
// ...

// namespaced templates will no longer work
// namespaced templates will no longer work in controllers
$this->render('@Acme/Default/index.html.twig');

// traditional template notation will work
// you must use the traditional template notation
$this->render('AcmeBundle:Default:index.html.twig');
}

.. code-block:: jinja
{# inside a Twig template, namespaced templates work as expected #}
{{ include('@Acme/Default/index.html.twig') }}
{# traditional template notation will also work #}
{{ include('AcmeBundle:Default:index.html.twig') }}
.. index::
single: Templating; Layout
Expand Down

0 comments on commit 5e47417

Please sign in to comment.