Skip to content

Commit 9eefe1b

Browse files
committed
[VarDumper] Add support of named arguments to dd() and dump()
1 parent 0fbaf44 commit 9eefe1b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

templates.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,11 +728,19 @@ depending on your needs:
728728
and they are visible on the web page #}
729729
{{ dump(article) }}
730730

731+
{# optionally, use argument names to display them as labels next to
732+
the dumped contents #}
733+
{{ dump(blog_posts: articles, user: app.user) }}
734+
731735
<a href="/article/{{ article.slug }}">
732736
{{ article.title }}
733737
</a>
734738
{% endfor %}
735739

740+
.. versionadded:: 6.3
741+
742+
The option to use argument names in ``dump()`` was introduced in Symfony 6.3.
743+
736744
To avoid leaking sensitive information, the ``dump()`` function/tag is only
737745
available in the ``dev`` and ``test`` :ref:`configuration environments <configuration-environments>`.
738746
If you try to use it in the ``prod`` environment, you will see a PHP error.

0 commit comments

Comments
 (0)