twig dump variable code example
Example 1: dump all variables twig
{{ dump(user) }}
Example 2: twig is set variable
{# defined works with variable names #}
{% if foo is defined %}
...
{% endif %}
{# and attributes on variables names #}
{% if foo.bar is defined %}
...
{% endif %}
{% if foo['bar'] is defined %}
...
{% endif %}