View layer pattern where you only present what you have been given is fine and all, but how do you know what is available? Is there a \"list all defined variables\" function
If you are using Twig in your application as a component you can do this:
$twig = new Twig_Environment($loader, array( 'autoescape' => false )); $twig->addFilter('var_dump', new Twig_Filter_Function('var_dump'));
Then in your templates:
{{ my_variable | var_dump }}