From 1ddc77ae5d1825646ffeaa184a5246ed517c06c6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 16 Dec 2022 13:46:04 +0100 Subject: [PATCH] [VarDumper] Add support of named arguments to dd() and dump() --- templates.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates.rst b/templates.rst index 88e8f50b0a5..86bade24a70 100644 --- a/templates.rst +++ b/templates.rst @@ -728,11 +728,19 @@ depending on your needs: and they are visible on the web page #} {{ dump(article) }} + {# optionally, use named arguments to display them as labels next to + the dumped contents #} + {{ dump(blog_posts: articles, user: app.user) }} + {{ article.title }} {% endfor %} +.. versionadded:: 6.3 + + The option to use named arguments in ``dump()`` was introduced in Symfony 6.3. + To avoid leaking sensitive information, the ``dump()`` function/tag is only available in the ``dev`` and ``test`` :ref:`configuration environments `. If you try to use it in the ``prod`` environment, you will see a PHP error.