Guillaume Bois
Guillaume Bois

Reputation: 1331

Twig 1.24 don't have dump function

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

Answers (2)

arhey
arhey

Reputation: 311

You should add debug extension to your twig environment manually

$twig->addExtension(new Twig_Extension_Debug());

Upvotes: 0

Iaroslav Gashuk
Iaroslav Gashuk

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

Related Questions