Skip to content

Commit 4ddc58a

Browse files
committed
Fixed code examples in book/templating
1 parent 499a3d1 commit 4ddc58a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

book/templating.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ syntax for controllers (i.e. **bundle**:**controller**:**action**):
613613
.. code-block:: html+jinja
614614

615615
{# app/Resources/views/base.html.twig #}
616-
...
616+
617+
{# ... #}
617618

618619
<div id="sidebar">
619620
{% render "AcmeArticleBundle:Article:recentArticles" with {'max': 3} %}
@@ -622,7 +623,8 @@ syntax for controllers (i.e. **bundle**:**controller**:**action**):
622623
.. code-block:: html+php
623624

624625
<!-- app/Resources/views/base.html.php -->
625-
...
626+
627+
{# ... #}
626628

627629
<div id="sidebar">
628630
<?php echo $view['actions']->render('AcmeArticleBundle:Article:recentArticles', array('max' => 3)) ?>
@@ -720,7 +722,7 @@ correctly:
720722

721723
{# src/Acme/ArticleBundle/Resources/views/Article/recentList.html.twig #}
722724
{% for article in articles %}
723-
<a href="{{ path('article_show', { 'slug': article.slug }) }}">
725+
<a href="{{ path('article_show', {'slug': article.slug}) }}">
724726
{{ article.title }}
725727
</a>
726728
{% endfor %}
@@ -989,7 +991,8 @@ customize the markup specifically for your application. By digging into the
989991

990992
public function indexAction()
991993
{
992-
$blogs = // some logic to retrieve the blogs
994+
// some logic to retrieve the blogs
995+
$blogs = ...;
993996

994997
$this->render('AcmeBlogBundle:Blog:index.html.twig', array('blogs' => $blogs));
995998
}
@@ -1233,7 +1236,6 @@ Template parameters can then be dumped using the ``dump`` function:
12331236
.. code-block:: html+jinja
12341237

12351238
{# src/Acme/ArticleBundle/Resources/views/Article/recentList.html.twig #}
1236-
12371239
{{ dump(articles) }}
12381240

12391241
{% for article in articles %}

0 commit comments

Comments
 (0)