Caution
This extension is deprecated as of Twig 1.5. Use the Twig built-in dump function instead.
The debug extension provides a debug tag that can be used to
output the content of the current context:
1 | {% debug %}
|
This is really useful when a template does not work as expected. You can also output a specific variable or an expression:
1 2 3 | {% debug items %}
{% debug post.body %}
|
Caution
The debug tag only works when the debug environment option is set
to true.