Skip to content

Commit 1550871

Browse files
committed
switched usage of the include tag to the include function
1 parent abdcf9f commit 1550871

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

book/templating.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,7 @@ Including this template from any other template is simple:
532532
<h1>Recent Articles<h1>
533533

534534
{% 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}) }}
538536
{% endfor %}
539537
{% endblock %}
540538

@@ -551,7 +549,7 @@ Including this template from any other template is simple:
551549
<?php endforeach; ?>
552550
<?php $view['slots']->stop() ?>
553551

554-
The template is included using the ``{% include %}`` tag. Notice that the
552+
The template is included using the ``{{ include() }}`` function. Notice that the
555553
template name follows the same typical convention. The ``articleDetails.html.twig``
556554
template uses an ``article`` variable. This is passed in by the ``list.html.twig``
557555
template using the ``with`` command.

quick_tour/the_view.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ And change the ``index.html.twig`` template to include it:
170170
171171
{# override the body block from embedded.html.twig #}
172172
{% block content %}
173-
{% include "AcmeDemoBundle:Demo:embedded.html.twig" %}
173+
{{ include("AcmeDemoBundle:Demo:embedded.html.twig") }}
174174
{% endblock %}
175175
176176
Embedding other Controllers

0 commit comments

Comments
 (0)