init
This commit is contained in:
72
vendor/yiisoft/yii2-debug/views/default/panels/request/detail.php
vendored
Normal file
72
vendor/yiisoft/yii2-debug/views/default/panels/request/detail.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/* @var $panel yii\debug\panels\RequestPanel */
|
||||
|
||||
use yii\bootstrap\Tabs;
|
||||
|
||||
echo '<h1>Request</h1>';
|
||||
|
||||
$items = [];
|
||||
|
||||
$parametersContent = '';
|
||||
|
||||
if (isset($panel->data['general'])) {
|
||||
$parametersContent .= $this->render('table', ['caption' => 'General Info', 'values' => $panel->data['general']]);
|
||||
}
|
||||
|
||||
$parametersContent .= $this->render('table', [
|
||||
'caption' => 'Routing',
|
||||
'values' => [
|
||||
'Route' => $panel->data['route'],
|
||||
'Action' => $panel->data['action'],
|
||||
'Parameters' => $panel->data['actionParams'],
|
||||
],
|
||||
]);
|
||||
|
||||
if (isset($panel->data['GET'])) {
|
||||
$parametersContent .= $this->render('table', ['caption' => '$_GET', 'values' => $panel->data['GET']]);
|
||||
}
|
||||
|
||||
if (isset($panel->data['POST'])) {
|
||||
$parametersContent .= $this->render('table', ['caption' => '$_POST', 'values' => $panel->data['POST']]);
|
||||
}
|
||||
|
||||
if (isset($panel->data['FILES'])) {
|
||||
$parametersContent .= $this->render('table', ['caption' => '$_FILES', 'values' => $panel->data['FILES']]);
|
||||
}
|
||||
|
||||
if (isset($panel->data['COOKIE'])) {
|
||||
$parametersContent .= $this->render('table', ['caption' => '$_COOKIE', 'values' => $panel->data['COOKIE']]);
|
||||
}
|
||||
|
||||
$parametersContent .= $this->render('table', ['caption' => 'Request Body', 'values' => $panel->data['requestBody']]);
|
||||
|
||||
$items[] = [
|
||||
'label' => 'Parameters',
|
||||
'content' => $parametersContent,
|
||||
'active' => true,
|
||||
];
|
||||
|
||||
$items[] = [
|
||||
'label' => 'Headers',
|
||||
'content' => $this->render('table', ['caption' => 'Request Headers', 'values' => $panel->data['requestHeaders']])
|
||||
. $this->render('table', ['caption' => 'Response Headers', 'values' => $panel->data['responseHeaders']]),
|
||||
];
|
||||
|
||||
if (isset($panel->data['SESSION'], $panel->data['flashes'])) {
|
||||
$items[] = [
|
||||
'label' => 'Session',
|
||||
'content' => $this->render('table', ['caption' => '$_SESSION', 'values' => $panel->data['SESSION']])
|
||||
. $this->render('table', ['caption' => 'Flashes', 'values' => $panel->data['flashes']]),
|
||||
];
|
||||
}
|
||||
|
||||
if (isset($panel->data['SERVER'])) {
|
||||
$items[] = [
|
||||
'label' => '$_SERVER',
|
||||
'content' => $this->render('table', ['caption' => '$_SERVER', 'values' => $panel->data['SERVER']]),
|
||||
];
|
||||
}
|
||||
|
||||
echo Tabs::widget([
|
||||
'items' => $items,
|
||||
]);
|
||||
23
vendor/yiisoft/yii2-debug/views/default/panels/request/summary.php
vendored
Normal file
23
vendor/yiisoft/yii2-debug/views/default/panels/request/summary.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/* @var $panel yii\debug\panels\RequestPanel */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\web\Response;
|
||||
|
||||
$statusCode = $panel->data['statusCode'];
|
||||
if ($statusCode === null) {
|
||||
$statusCode = 200;
|
||||
}
|
||||
if ($statusCode >= 200 && $statusCode < 300) {
|
||||
$class = 'yii-debug-toolbar__label_success';
|
||||
} elseif ($statusCode >= 300 && $statusCode < 400) {
|
||||
$class = 'yii-debug-toolbar__label_info';
|
||||
} else {
|
||||
$class = 'yii-debug-toolbar__label_important';
|
||||
}
|
||||
$statusText = Html::encode(isset(Response::$httpStatuses[$statusCode]) ? Response::$httpStatuses[$statusCode] : '');
|
||||
?>
|
||||
<div class="yii-debug-toolbar__block">
|
||||
<a href="<?= $panel->getUrl() ?>" title="Status code: <?= $statusCode ?> <?= $statusText ?>">Status <span class="yii-debug-toolbar__label <?= $class ?>"><?= $statusCode ?></span></a>
|
||||
<a href="<?= $panel->getUrl() ?>" title="Action: <?= $panel->data['action'] ?>">Route <span class="yii-debug-toolbar__label"><?= $panel->data['route'] ?></span></a>
|
||||
</div>
|
||||
35
vendor/yiisoft/yii2-debug/views/default/panels/request/table.php
vendored
Normal file
35
vendor/yiisoft/yii2-debug/views/default/panels/request/table.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* @var $caption string */
|
||||
/* @var $values array */
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\VarDumper;
|
||||
?>
|
||||
<h3><?= $caption ?></h3>
|
||||
|
||||
<?php if (empty($values)): ?>
|
||||
|
||||
<p>Empty.</p>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed table-bordered table-striped table-hover request-table" style="table-layout: fixed;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($values as $name => $value): ?>
|
||||
<tr>
|
||||
<th><?= Html::encode($name) ?></th>
|
||||
<td><?= htmlspecialchars(VarDumper::dumpAsString($value), ENT_QUOTES|ENT_SUBSTITUTE, \Yii::$app->charset, true) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user