From dd715fc0fbe3922b626e7165cc6449b25a5983b6 Mon Sep 17 00:00:00 2001 From: Henry Snoek Date: Sun, 22 Apr 2018 16:55:19 +0200 Subject: [PATCH 1/2] dd() helper method tip --- components/var_dumper.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/var_dumper.rst b/components/var_dumper.rst index 884dcfb76c8..4d18b909419 100644 --- a/components/var_dumper.rst +++ b/components/var_dumper.rst @@ -82,6 +82,14 @@ current PHP SAPI: #. From time to time, run ``composer global update symfony/var-dumper`` to have the latest bug fixes. +.. tip:: + + The VarDumper component also has a ``dd()`` helper method. This dump and die + functionality will call ``dump()`` and ``exit()``. + +.. versionadded:: 4.1 + The ``dd()`` helper method was introduced in Symfony 4.1. + DebugBundle and Twig Integration -------------------------------- @@ -93,8 +101,9 @@ of your application may just break it by e.g. sending HTTP headers or corrupting your view, the bundle configures the ``dump()`` function so that variables are dumped in the web debug toolbar. -But if the toolbar cannot be displayed because you e.g. called ``die``/``exit`` -or a fatal error occurred, then dumps are written on the regular output. +But if the toolbar cannot be displayed because you e.g. called +``die``/``exit``/``dd`` or a fatal error occurred, then dumps are written on +the regular output. In a Twig template, two constructs are available for dumping a variable. Choosing between both is mostly a matter of personal taste, still: From a82d95f7d15aa98a68c469e78e249527521f3369 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 23 Apr 2018 15:12:06 +0200 Subject: [PATCH 2/2] Minor rewords --- components/var_dumper.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/var_dumper.rst b/components/var_dumper.rst index 4d18b909419..ffc087e8b14 100644 --- a/components/var_dumper.rst +++ b/components/var_dumper.rst @@ -84,11 +84,12 @@ current PHP SAPI: .. tip:: - The VarDumper component also has a ``dd()`` helper method. This dump and die - functionality will call ``dump()`` and ``exit()``. + The VarDumper component also includes a ``dd()`` helper method. This "dump + and die" feature calls ``dump()`` and stops the application immediately + after with ``exit()``. -.. versionadded:: 4.1 - The ``dd()`` helper method was introduced in Symfony 4.1. + .. versionadded:: 4.1 + The ``dd()`` helper method was introduced in Symfony 4.1. DebugBundle and Twig Integration -------------------------------- @@ -102,8 +103,8 @@ corrupting your view, the bundle configures the ``dump()`` function so that variables are dumped in the web debug toolbar. But if the toolbar cannot be displayed because you e.g. called -``die``/``exit``/``dd`` or a fatal error occurred, then dumps are written on -the regular output. +``die()``/``exit()``/``dd()`` or a fatal error occurred, then dumps are written +on the regular output. In a Twig template, two constructs are available for dumping a variable. Choosing between both is mostly a matter of personal taste, still: