RsD0p9BK
5/13/2016 - 8:38 AM

From http://stackoverflow.com/questions/7317438/how-to-var-dump-variables-in-twig-templates

$twig = new Twig_Environment($loader, array(
    'autoescape' => false
));

$twig->addFilter('var_dump', new Twig_Filter_Function('var_dump'));

// how to use
// {{ my_variable | var_dump }}