Reputation: 1331
I need the dump function to be able to troubleshoot a template. I see that dump function is available in 1.5, I have 1.24
When I print the twig version with
The current version is {{ constant('Twig_Environment::VERSION') }}
I get 1.24.0. But when I use the dump function:
{{ dump() }}
I get a Slim Application Error:
Type: Twig_Error_Syntax
Message: Unknown "dump" function in "template.html.twig" at line 15.
What did I do wrong?
Upvotes: 0
Views: 957
Reputation: 311
You should add debug extension to your twig environment manually
$twig->addExtension(new Twig_Extension_Debug());
Upvotes: 0
Reputation: 191
Actually the 1.5 version is older than 1.24 (24 greater than 5). The 1.24 version is the latest stable one and the dump
function is supported by it
Upvotes: 3