How to var_dump variables in twig templates?

As of Twig 1.5, the correct answer is to use the dump function. It is fully documented in the Twig documentation. Here is the documentation to enable this inside Symfony.

{{ dump(user) }}

Leave a Comment