When I was working on an older project (Symfony 3.2), the {{ dump(var) }}
in twig templates was displaying just fine (with style and expand/collapse capabilities). But on my recent project (Symfony 4), the dump
function in twig is displaying the text only.
I looked in the docs, GitHub issues for both Symfony and Twig and in SO without any success.
Docs:
Is there anything that have changed which I didn't see?
Edit: I got the desired result using dump()
in PHP (got the syntax color & collapse/expand), but I still don't understand why it is not working for twig like it is in older Symfony version. I must be missing something...
<pre>
tag if you activated xdebug. In fact, just using{{ dump() }}
does create the<pre>
tag by itself (so you get readable lines instead of one big block), so I guess it's fine on the xdebug side? – Marc-André