Пример #1
0
<form id="timeline-control" class="op-control" action="" method="get">
    <input type="hidden" name="panel" value="time">
    Threshold <input type="number" size="3" name="threshold" value="1" min="0"> ms
</form>
<h2>Time</h2>

<?php 
$token = 'laravel';
$profile = null;
$colors = array('default' => '#aacd4e', 'section' => '#666', 'event_listener' => '#3dd', 'template' => '#dd3');
echo display_timeline('timeline_' . $token, $colors);
// no child requests in laravel
/*
foreach ($profile->children as $child) {
    $events = $child->getcollector('time')->getEvents();
    echo '<h3>' .
        'Sub-request " . $child->getcollector("request")->requestattributes->get("_controller")' .
        '<small> - ' . $events['__section__']->getDuration() . ' ms</small>' .
        '</h3>';
}
*/
?>

<script>

    window.onigoetz_profiler = {};
    window.onigoetz_profiler.colors = <?php 
echo json_encode($colors);
?>
;
    window.onigoetz_profiler.requests_data = <?php 
function timeline_shortcode($atts)
{
    $args = shortcode_atts(array('cat' => '0', 'type' => 'post', 'show' => 5, 'date' => 'Y', 'length' => 10, 'images' => 'no'), $atts);
    return display_timeline($args);
}