This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi!
Working on a component, I try to use this on the default partial as it is on the documentation:
{{ dump($var) }}
But I get this error:
Twig\Error\SyntaxError: Unknown "dump" function in
On the forum I found an old post about enable twig dump with an old solution, but I'm thinking that was a lot of improvements on this time that I'm expect the use of dump() function should be fixed.
Should it work out of the box or has to be configured in any way?
Regards...
dump() should work in twig, what version of october are you using?!
Also, twig does not use "$" in fromt of variable names so that should be {{ dump(var) }}
I confirm that it doesn't work:
{{ dump() }}
Gives an error 'unknown function do you mean var_dump...?' (It tried to debug a twig template in a Mail::send('myname.myplugin::mail.mytemplate', ... ) I use the last version of October
mjauvin said:
I think it only works in debug mode (app.debug=true)
Debug mode is on, but I got this error:
"Unknown "dump" function. Did you mean "var_dump" in "__string_template__ca89786fac42d5dcb6c2589ec02085c2e823ad64c086a6a1c4b74a9c58f5ee63" at line 1?" on line 746 of /home/******/vendor/twig/twig/src/ExpressionParser.php
1-8 of 8