Is it possible to retrieve all variables inside a Twig template with PHP?
Example someTemplate.twig.php:
Hello {{ name }},
your new email is {{ ema
After using duncan's answer for quite some time I finally found the "right" way to dump all twig variables of a template:
{% dump %}
That's it. All the variables available in the template will be dumped and in the dump section of the profiler, not in the middle of your html like with {{ dump() }}.
if you put the contents of dump() into a variable:
{% set d = dump() %}
you 'll get all the variables but in "dump ready" html so it would be a pain to parse it.
Hope that helps.