mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 13:28:35 +01:00
29 lines
1.1 KiB
PHP
29 lines
1.1 KiB
PHP
<?php
|
|
|
|
include __DIR__ . '/vendor/autoload.php';
|
|
include __DIR__ . '/../../bootstrap.php';
|
|
|
|
$debugbarRenderer->setBaseUrl('../../../src/DebugBar/Resources');
|
|
|
|
$loader = new Twig\Loader\FilesystemLoader('.');
|
|
$twig = new Twig\Environment($loader);
|
|
$profile = new Twig\Profiler\Profile();
|
|
|
|
// enable template measure on timeline
|
|
$twig->addExtension(new DebugBar\Bridge\Twig\TimeableTwigExtensionProfiler($profile, $debugbar['time']));
|
|
|
|
// enable {% measure 'foo' %} {% endmeasure %} tags for time measure on templates
|
|
$twig->addExtension(new DebugBar\Bridge\Twig\MeasureTwigExtension($debugbar['time']));
|
|
|
|
$twig->enableDebug();
|
|
// enable {{ dump('foo') }} function on templates
|
|
$twig->addExtension(new DebugBar\Bridge\Twig\DumpTwigExtension());
|
|
// enable {{ debug('foo') }} function on templates
|
|
$twig->addExtension(new DebugBar\Bridge\Twig\DebugTwigExtension($debugbar['messages']));
|
|
|
|
$debugbar->addCollector(new DebugBar\Bridge\NamespacedTwigProfileCollector($profile, $twig));
|
|
|
|
render_demo_page(function() use ($twig) {
|
|
echo $twig->render('hello.html', array('name' => 'peter pan'));
|
|
});
|