1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 13:28:35 +01:00
php-debugbar/demo/bootstrap.php
2013-08-12 18:49:21 +10:00

39 lines
1016 B
PHP

<?php
include __DIR__ . '/../tests/bootstrap.php';
use DebugBar\StandardDebugBar;
$debugbar = new StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer()->setBaseUrl('../src/DebugBar/Resources');
function render_demo_page(Closure $callback = null)
{
global $debugbarRenderer;
?>
<html>
<head>
<?php echo $debugbarRenderer->renderHead() ?>
<script type="text/javascript">
$(function() {
$('.ajax').click(function() {
var container = $(this).parent().html('...');
$.get(this.href, function(data) {
container.html(data);
});
return false;
});
});
</script>
</head>
<body>
<h1>DebugBar Demo</h1>
<p>DebugBar at the bottom of the page</p>
<?php if ($callback) $callback(); ?>
<?php
echo $debugbarRenderer->render();
?>
</body>
</html>
<?php
}