I would like to load a new extension in a symfony2
project for twig
but I don't know where should I put line below to work :
$twig = new Twig_Environment($loader, $config);
$twig->addExtension(new Twig_Extension_Debug());
Any tutorials for http://twig.sensiolabs.org/doc/functions/dump.html ?
I could add debug for twig like below :
# app/config/config.yml
services:
acme_hello.twig.extension.debug:
class: Twig_Extension_Debug
tags:
- { name: 'twig.extension' }
Look here for more details;
You have to create a service with twig.extension
tag. See here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With