php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

Twig : 0 templates were rendered

Open Merrick28 opened this issue 9 years ago • 2 comments

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 ?

Merrick28 avatar Dec 24 '15 06:12 Merrick28

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.

barryvdh avatar Dec 24 '15 07:12 barryvdh

Ok, it's not a big deal for me, Twig isn't the topic I would like to monitor :) Thanks for your great work.

Merrick28 avatar Dec 24 '15 11:12 Merrick28