I tried to use the wonderful dump function from the var-dumper bundle in symfony 4 and for some reason I get the following error:
Failed to start the session because headers have already been sent by "vendor\symfony\var-dumper\Dumper\AbstractDumper.php" at line 181.
Additionally, when I try to use the {% dump foo %} tag in a twig template I get an error:
Unknown "dump" tag.
Can anyone help me?
dump
is not a tag, it's a function. So change{% dump foo %}
into{% dump(foo) %}
– Matias Kinnunendump
tag. And yeah, my bad, I meant to say{{ dump(foo) }}
. – Have you installedsymfony/var-dumper
orsymfony/debug-bundle
? See symfony.com/doc/current/components/var_dumper.html#installation – Matias Kinnunen