Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

24 lines
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>