Reputation: 1058
I just wanted to know if there is this function in Symfony2 that would print human-readable information about a variable (the same as print_r() in PHP)?
Thanks
Upvotes: 1
Views: 578
Reputation: 441
You can use the {{ dump(the_variable) }}
function from Twig.
It is a helper, equivalent of var_dump in PHP, contained in a output buffer.
To enable such function, please check that in your config.yml
file, this is configured:
twig:
...
debug:%kernel.debug%
Upvotes: 2