I am a little bit confused right now. I always used the twig dump function like any other twig function but now it has absolutely no output. No errors/exceptions, just nothing. Everything else is working fine, like the trans filter.
{{ dump('test') }} # prints nothing
{{ 'layout.booking.chooseArea'|trans }} # prints the translated message
Right now this template doesn't contain anything more than that. The dump also doesn't work in the parent template or in base.html.twig.
Again, the dump prints nothing: not an empty string, not null, not a single pixel on the screen.
Any ideas what could cause this?
Symfony version: 2.6.x-dev
update
{{ dump('test') }} # doesn't work (anymore?)
{% dump('test') %} # does (still) work
Has this been removed or something? Why are there no errors? By the way... debug flag is set.
In Symfony 2.6, there is a new VarDumper component and DebugBundle. These override twig's
dump()
function to give a lot more and nicer dump output.However, you have to register the DebugBundle in your
AppKernel
, otherwise it'll just ignore the call. To do this, you should add this toapp/AppKernel.php
:Please note that this new dump function will dump the output in the web dev toolbar, to avoid screwing up the page layout.