PHP code example of idmarinas / tracy-twig-bar

1. Go to this page and download the library: Download idmarinas/tracy-twig-bar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

idmarinas / tracy-twig-bar example snippets


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);