8000 Added a note about the side effects of enabling both PHP and Twig · symfony/symfony-docs@3828162 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3828162

Browse files
committed
Added a note about the side effects of enabling both PHP and Twig 8000
1 parent 7cbad6d commit 3828162

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cookbook/templating/PHP.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,24 @@ shortcut to render the default ``AcmeHelloBundle:Hello:index.html.php`` template
7777
return array('name' => $name);
7878
}
7979

80+
.. caution::
81+
82+
Enabling the ``php`` and ``twig`` template engines simultaneously is
83+
allowed but it will produce an important side effect in your application:
84+
template namespaces will no longer work::
85+
86+
public function indexAction()
87+
{
88+
// ...
89+
90+
// namespaced templates will no longer work
91+
$this->render('@Acme/Default/index.html.twig');
92+
93+
// traditional template notation will work
94+
$this->render('AcmeBundle:Default:index.html.twig');
95+
}
96+
97+
8098
.. index::
8199
single: Templating; Layout
82100
single: Layout

0 commit comments

Comments
 (0)
0