eli123
eli123

Reputation: 1058

Equivalent of print_r function in Symfony2

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

Answers (1)

Ninir
Ninir

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

Related Questions