File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -80,20 +80,28 @@ shortcut to render the default ``AcmeHelloBundle:Hello:index.html.php`` template
80
80
.. caution ::
81
81
82
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::
83
+ allowed but it will produce an undesirable side effect in your application.
84
+ Template namespaces will no longer work except inside Twig templates ::
85
85
86
86
public function indexAction()
87
87
{
88
88
// ...
89
89
90
- // namespaced templates will no longer work
90
+ // namespaced templates will no longer work in controllers
91
91
$this->render('@Acme/Default/index.html.twig');
92
92
93
- // traditional template notation will work
93
+ // you must use the traditional template notation
94
94
$this->render('AcmeBundle:Default:index.html.twig');
95
95
}
96
96
97
+ .. code-block :: jinja
98
+
99
+ {# inside a Twig template, namespaced templates work as expected #}
100
+ {{ include('@Acme/Default/index.html.twig') }}
101
+
102
+ {# traditional template notation will also work #}
103
+ {{ include('AcmeBundle:Default:index.html.twig') }}
104
+
97
105
98
106
.. index ::
99
107
single: Templating; Layout
You can’t perform that action at this time.
0 commit comments