File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -532,9 +532,7 @@ Including this template from any other template is simple:
532
532
<h1>Recent Articles<h1>
533
533
534
534
{% for article in articles %}
535
- {% include 'AcmeArticleBundle:Article: articleDetails.html.twig'
536
- with {'article': article}
537
- %}
535
+ {{ include('AcmeArticleBundle:Article: articleDetails.html.twig', {'article': article}) }}
538
536
{% endfor %}
539
537
{% endblock %}
540
538
@@ -551,7 +549,7 @@ Including this template from any other template is simple:
551
549
<?php endforeach; ?>
552
550
<?php $view['slots']->stop() ?>
553
551
554
- The template is included using the ``{% include %} `` tag . Notice that the
552
+ The template is included using the ``{{ include() }} `` function . Notice that the
555
553
template name follows the same typical convention. The ``articleDetails.html.twig ``
556
554
template uses an ``article `` variable. This is passed in by the ``list.html.twig ``
557
555
template using the ``with `` command.
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ And change the ``index.html.twig`` template to include it:
170
170
171
171
{# override the body block from embedded.html.twig #}
172
172
{% block content %}
173
- {% include "AcmeDemoBundle:Demo:embedded.html.twig" % }
173
+ {{ include( "AcmeDemoBundle:Demo:embedded.html.twig") } }
174
174
{% endblock %}
175
175
176
176
Embedding other Controllers
You can’t perform that action at this time.
0 commit comments