Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Allow use of dump() in Twig templates to use the Symfony dumper output

Open joachim-n opened this issue 5 years ago • 1 comments

If I use var-dumper's dump() in PHP code, I get very nicely formatted output of the variable in the HTML page.

However, using {{ dump(foo.bar) }} in a Twig template (as documented at https://symfony.com/doc/4.1/templating/debug.html) shows raw unformatted code.

It would be great if this could instead produce the same formatted output as dump() in PHP.

joachim-n avatar Feb 03 '20 10:02 joachim-n

dump() function in Twig seems to be not maintained anymore. It might be on purpose (sadly) but I can confirm that in raw Symfony 5.0.* project formatting is not supported for Twig's dump().

rafalswierczek avatar Jul 22 '20 05:07 rafalswierczek