php-debugbar
php-debugbar copied to clipboard
Twig : 0 templates were rendered
Hello everyone,
I just installed this tool, and it works great, except for Twig. I have to precise that I don't use Symfony, it's a non-framework project.
I think I've made a mistake somewehere.
Here is my (simplified) code :
use DebugBar\StandardDebugBar;
$debugbar = new StandardDebugBar();
$loader = new Twig_Loader_Filesystem(CHEMIN . '/templates');
$twig = new DebugBar\Bridge\Twig\TraceableTwigEnvironment(new Twig_Environment($loader, array()));
$debugbar->addCollector(new DebugBar\Bridge\Twig\TwigCollector($twig));
$optionsTwig = array(
'TITLE' => 'Test de titre',
);
echo $twig->render('page.twig',$optionsTwig);
echo $debugbarRenderer->render();
I can see the phpdebugbar, and there is a twig tab, but there's always "0 templates were rendered". What did I miss ?
The Twig loader is currently a bit out-dated. It should be updated but don't have the time yet.
Not really sure what's wrong here.
Ok, it's not a big deal for me, Twig isn't the topic I would like to monitor :) Thanks for your great work.