Twig
Twig copied to clipboard
Allow use of dump() in Twig templates to use the Symfony dumper output
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.
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().