idmarinas / tracy-twig-bar
A Tracy panel for Twig Template Engine
Fund package maintenance!
Liberapay
Installs: 7 806
Dependents: 2
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.2 | ^8.0 | ^8.1
- tracy/tracy: ^2.7
- twig/twig: ^2.0 || ^3.0
Requires (Dev)
- rector/rector: ^0.12.5
README
Twig Panel for Tracy
Add Twig template info in the Tracy debugger bar.
Installation
Composer
composer require --dev idmarinas/tracy-twig-bar
Usage
Somewhere, when your application start 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);