A Tracy panel for Twig Template Engine
Add Twig template info in the Tracy debugger bar.
🖖 Support
🩵 If you like this project, give it a 🌟 and share it with your friends!
composer require --dev idmarinas/tracy-twig-bar
Somewhere, when your application starts and you initialize Twig engine
use Idmarinas\TracyPanel\TwigBar;
use Idmarinas\TracyPanel\Twig\TracyExtension;
use Twig\Environment;
use Twig\Extension\ProfilerExtension;
use Twig\Profiler\Profile;
// ...
$profile = new Profile();
$env = new Environment($loader, $options);
$env->addExtension(new ProfilerExtension($profile));
/**
* Optional Twig Extension.
*
* Can use `dump`, `dumpe` and `bdump` functions of Tracy
*/
$env->addExtension(new TracyExtension()); //-- Optional
TwigBar::init($profile);