1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 21:38:14 +01:00

29 lines
1.1 KiB
PHP
Raw Normal View History

2013-08-12 19:01:01 +10:00
<?php
include __DIR__ . '/vendor/autoload.php';
include __DIR__ . '/../../bootstrap.php';
2013-08-12 19:15:54 +10:00
$debugbarRenderer->setBaseUrl('../../../src/DebugBar/Resources');
2024-02-19 15:37:40 -05:00
$loader = new Twig\Loader\FilesystemLoader('.');
$twig = new Twig\Environment($loader);
$profile = new Twig\Profiler\Profile();
2024-03-20 13:43:14 -05:00
// enable template measure on timeline
$twig->addExtension(new DebugBar\Bridge\Twig\TimeableTwigExtensionProfiler($profile, $debugbar['time']));
2013-08-12 19:01:01 +10:00
2024-03-20 13:43:14 -05:00
// 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']));
2024-02-19 15:37:40 -05:00
$debugbar->addCollector(new DebugBar\Bridge\NamespacedTwigProfileCollector($profile, $twig));
2013-08-12 19:01:01 +10:00
render_demo_page(function() use ($twig) {
echo $twig->render('hello.html', array('name' => 'peter pan'));
});