您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
974B

  1. <?php
  2. /* @var $panel yii\debug\panels\RequestPanel */
  3. use yii\helpers\Html;
  4. use yii\web\Response;
  5. $statusCode = $panel->data['statusCode'];
  6. if ($statusCode === null) {
  7. $statusCode = 200;
  8. }
  9. if ($statusCode >= 200 && $statusCode < 300) {
  10. $class = 'yii-debug-toolbar__label_success';
  11. } elseif ($statusCode >= 300 && $statusCode < 400) {
  12. $class = 'yii-debug-toolbar__label_info';
  13. } else {
  14. $class = 'yii-debug-toolbar__label_important';
  15. }
  16. $statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Response::$httpStatuses[$statusCode] : '');
  17. ?>
  18. <div class="yii-debug-toolbar__block">
  19. <a href="<?= $panel->getUrl() ?>" title="Status code: <?= $statusCode ?> <?= $statusText ?>">Status <span class="yii-debug-toolbar__label <?= $class ?>"><?= $statusCode ?></span></a>
  20. <a href="<?= $panel->getUrl() ?>" title="Action: <?= $panel->data['action'] ?>">Route <span class="yii-debug-toolbar__label"><?= $panel->data['route'] ?></span></a>
  21. </div>