File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ for example, inside your controller::
33
33
The output of the ``dump() `` function is then rendered in the web developer
34
34
toolbar.
35
35
36
- In a Twig template, two constructs are available for dumping a variable.
37
- Choosing between both is mostly a matter of personal taste, still:
36
+ In a Twig template, you can use the ``dump `` utility as a function or a tag:
38
37
39
38
* ``{% dump foo.bar %} `` is the way to go when the original template output
40
39
shall not be modified: variables are not dumped inline, but in the web
@@ -46,22 +45,13 @@ Choosing between both is mostly a matter of personal taste, still:
46
45
.. code-block :: html+twig
47
46
48
47
{# app/Resources/views/article/recent_list.html.twig #}
48
+ {# the contents of this variable are sent to the Web Debug Toolbar #}
49
49
{% dump articles %}
50
50
51
51
{% for article in articles %}
52
- <a href="/article/{{ article.slug }}">
53
- {{ article.title }}
54
- </a>
55
- {% endfor %}
56
-
57
- or
52
+ {# the contents of this variable are display on the web page #}
53
+ {{ dump(article) }}
58
54
59
- .. code-block :: html+twig
60
-
61
- {# app/Resources/views/article/recent_list.html.twig #}
62
- {{ dump(articles) }}
63
-
64
- {% for article in articles %}
65
55
<a href="/article/{{ article.slug }}">
66
56
{{ article.title }}
67
57
</a>
You can’t perform that action at this time.
0 commit comments