summary.php 839 Bytes
Newer Older
1 2 3 4
<?php
use yii\helpers\Html;
use yii\web\Response;

Qiang Xue committed
5 6 7 8 9
/**
 * @var yii\debug\panels\RequestPanel $panel
 */

$statusCode = $panel->data['statusCode'];
10
if ($statusCode === null) {
11
    $statusCode = 200;
12 13
}
if ($statusCode >= 200 && $statusCode < 300) {
14
    $class = 'label-success';
15
} elseif ($statusCode >= 300 && $statusCode < 400) {
16
    $class = 'label-info';
17
} else {
18
    $class = 'label-important';
19 20 21 22
}
$statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Response::$httpStatuses[$statusCode] : '');
?>
<div class="yii-debug-toolbar-block">
23 24
    <a href="<?= $panel->getUrl() ?>" title="Status code: <?= $statusCode ?> <?= $statusText ?>">Status <span class="label <?= $class ?>"><?= $statusCode ?></span></a>
    <a href="<?= $panel->getUrl() ?>">Action <span class="label"><?= $panel->data['action'] ?></span></a>
Qiang Xue committed
25
</div>