maximebf / php-debugbar

Debug bar for PHP
phpdebugbar.com
MIT License
4.2k stars 400 forks source link

Twig coillector and Slim #208

Closed borgogelli closed 9 years ago

borgogelli commented 9 years ago

Hi

I'm using Slimframework with Twig view and DebugBar

$debugbar = new StandardDebugBar();
// Twig collector
$twig = $app->view->getEnvironment(); // $app is an instance of the class Slim\Slim
$env = new TraceableTwigEnvironment($twig);
$debugbar->addCollector(new TwigCollector($env));

when i load a web page, on the debugbar I always read

0 templates were rendered

Any advice ?

Thank you in advance

barryvdh commented 9 years ago

Can you replace the view environment? eg. $app->view->setEnvironment($env);?

But we'll probably rework the Twig collector soon.

borgogelli commented 9 years ago

you're right, but I don't know how to replace/set the TraceableTwigEnvironment in Slim view So I close that issue and open a new one in the right project https://github.com/slimphp/Slim-Views/issues/45 Thank you.