Commit 477ee2e5 by Carsten Brandt

added information about request body to debug toolbar

parent 9822dfae
...@@ -25,10 +25,15 @@ ul.trace { ...@@ -25,10 +25,15 @@ ul.trace {
} }
td, th { td, th {
white-space: pre-line; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
} }
.request-table td {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
word-break: break-all;
}
.detail-grid-view th { .detail-grid-view th {
white-space: nowrap; white-space: nowrap;
} }
......
...@@ -80,6 +80,11 @@ class RequestPanel extends Panel ...@@ -80,6 +80,11 @@ class RequestPanel extends Panel
'route' => Yii::$app->requestedAction ? Yii::$app->requestedAction->getUniqueId() : Yii::$app->requestedRoute, 'route' => Yii::$app->requestedAction ? Yii::$app->requestedAction->getUniqueId() : Yii::$app->requestedRoute,
'action' => $action, 'action' => $action,
'actionParams' => Yii::$app->requestedParams, 'actionParams' => Yii::$app->requestedParams,
'requestBody' => Yii::$app->getRequest()->getRawBody() == '' ? [] : [
'Content Type' => Yii::$app->getRequest()->getContentType(),
'Raw' => Yii::$app->getRequest()->getRawBody(),
'Decoded to Params' => Yii::$app->getRequest()->getBodyParams(),
],
'SERVER' => empty($_SERVER) ? [] : $_SERVER, 'SERVER' => empty($_SERVER) ? [] : $_SERVER,
'GET' => empty($_GET) ? [] : $_GET, 'GET' => empty($_GET) ? [] : $_GET,
'POST' => empty($_POST) ? [] : $_POST, 'POST' => empty($_POST) ? [] : $_POST,
......
<?php <?php
use yii\bootstrap\Tabs; use yii\bootstrap\Tabs;
use yii\helpers\VarDumper;
/** /**
* @var yii\debug\panels\RequestPanel $panel * @var yii\debug\panels\RequestPanel $panel
...@@ -13,7 +14,8 @@ echo Tabs::widget([ ...@@ -13,7 +14,8 @@ echo Tabs::widget([
. $this->render('panels/request/table', ['caption' => '$_GET', 'values' => $panel->data['GET']]) . $this->render('panels/request/table', ['caption' => '$_GET', 'values' => $panel->data['GET']])
. $this->render('panels/request/table', ['caption' => '$_POST', 'values' => $panel->data['POST']]) . $this->render('panels/request/table', ['caption' => '$_POST', 'values' => $panel->data['POST']])
. $this->render('panels/request/table', ['caption' => '$_FILES', 'values' => $panel->data['FILES']]) . $this->render('panels/request/table', ['caption' => '$_FILES', 'values' => $panel->data['FILES']])
. $this->render('panels/request/table', ['caption' => '$_COOKIE', 'values' => $panel->data['COOKIE']]), . $this->render('panels/request/table', ['caption' => '$_COOKIE', 'values' => $panel->data['COOKIE']])
. $this->render('panels/request/table', ['caption' => 'Request Body', 'values' => $panel->data['requestBody']]),
'active' => true, 'active' => true,
], ],
[ [
......
...@@ -15,7 +15,7 @@ use yii\helpers\VarDumper; ...@@ -15,7 +15,7 @@ use yii\helpers\VarDumper;
<?php else: ?> <?php else: ?>
<table class="table table-condensed table-bordered table-striped table-hover" style="table-layout: fixed;"> <table class="table table-condensed table-bordered table-striped table-hover request-table" style="table-layout: fixed;">
<thead> <thead>
<tr> <tr>
<th style="width: 200px;">Name</th> <th style="width: 200px;">Name</th>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment