diff --git a/framework/yii/debug/panels/RequestPanel.php b/framework/yii/debug/panels/RequestPanel.php index ba98005..2db6d20 100644 --- a/framework/yii/debug/panels/RequestPanel.php +++ b/framework/yii/debug/panels/RequestPanel.php @@ -8,6 +8,7 @@ namespace yii\debug\panels; use yii\debug\Panel; +use yii\helpers\Html; /** * @author Qiang Xue @@ -38,7 +39,12 @@ EOD; public function getDetail() { - return '

Request

'; + return "

\$_GET

\n" . $this->renderTable($this->data['GET']) . "\n" + . "

\$_POST

\n" . $this->renderTable($this->data['POST']) . "\n" + . "

\$_COOKIE

\n" . $this->renderTable($this->data['COOKIE']) . "\n" + . "

\$_FILES

\n" . $this->renderTable($this->data['FILES']) . "\n" + . "

\$_SESSION

\n" . $this->renderTable($this->data['SESSION']) . "\n" + . "

\$_SERVER

\n" . $this->renderTable($this->data['SERVER']); } public function save() @@ -54,4 +60,17 @@ EOD; 'SESSION' => empty($_SESSION) ? array() : $_SESSION, ); } + + protected function renderTable($values) + { + $rows = array(); + foreach ($values as $name => $value) { + $rows[] = '' . Html::encode($name) . '' . Html::encode(var_export($value, true)) . ''; + } + if (!empty($rows)) { + return "\n\n\n\n\n" . implode("\n", $rows) . "\n\n
NameValue
"; + } else { + return 'Empty.'; + } + } } diff --git a/framework/yii/debug/views/default/index.php b/framework/yii/debug/views/default/index.php index 5af7755..87e676e 100644 --- a/framework/yii/debug/views/default/index.php +++ b/framework/yii/debug/views/default/index.php @@ -9,8 +9,21 @@ use yii\helpers\Html; * @var \yii\debug\Panel $activePanel */ ?> - -getName()), array('debug/default/index', 'tag' => $tag, 'panel' => $panel->id)); ?>
- +
+
+ +
+
+ getDetail(); ?> +
+
-getDetail(); ?> diff --git a/framework/yii/debug/views/layouts/main.php b/framework/yii/debug/views/layouts/main.php index c43f3ff..7a3b55c 100644 --- a/framework/yii/debug/views/layouts/main.php +++ b/framework/yii/debug/views/layouts/main.php @@ -4,6 +4,8 @@ * @var string $content */ use yii\helpers\Html; + +Yii::$app->getView()->registerAssetBundle('yii/bootstrap/responsive'); ?> @@ -14,7 +16,11 @@ use yii\helpers\Html; beginBody(); ?> - +
+
+ +
+
endBody(); ?> endPage(); ?>