Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
1e93fcf2
Commit
1e93fcf2
authored
Jul 05, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug toolbar WIP
parent
a622424d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
6 deletions
+44
-6
RequestPanel.php
framework/yii/debug/panels/RequestPanel.php
+20
-1
index.php
framework/yii/debug/views/default/index.php
+17
-4
main.php
framework/yii/debug/views/layouts/main.php
+7
-1
No files found.
framework/yii/debug/panels/RequestPanel.php
View file @
1e93fcf2
...
...
@@ -8,6 +8,7 @@
namespace
yii\debug\panels
;
use
yii\debug\Panel
;
use
yii\helpers\Html
;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
...
...
@@ -38,7 +39,12 @@ EOD;
public
function
getDetail
()
{
return
'<h2>Request</h2>'
;
return
"<h3>
\$
_GET</h3>
\n
"
.
$this
->
renderTable
(
$this
->
data
[
'GET'
])
.
"
\n
"
.
"<h3>
\$
_POST</h3>
\n
"
.
$this
->
renderTable
(
$this
->
data
[
'POST'
])
.
"
\n
"
.
"<h3>
\$
_COOKIE</h3>
\n
"
.
$this
->
renderTable
(
$this
->
data
[
'COOKIE'
])
.
"
\n
"
.
"<h3>
\$
_FILES</h3>
\n
"
.
$this
->
renderTable
(
$this
->
data
[
'FILES'
])
.
"
\n
"
.
"<h3>
\$
_SESSION</h3>
\n
"
.
$this
->
renderTable
(
$this
->
data
[
'SESSION'
])
.
"
\n
"
.
"<h3>
\$
_SERVER</h3>
\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
[]
=
'<tr><th>'
.
Html
::
encode
(
$name
)
.
'</th><td>'
.
Html
::
encode
(
var_export
(
$value
,
true
))
.
'</td></tr>'
;
}
if
(
!
empty
(
$rows
))
{
return
"<table class=
\"
table table-condensed table-bordered table-hover
\"
>
\n
<thead>
\n
<tr><th>Name</th><th>Value</th></tr>
\n
</thead>
\n
<tbody>
\n
"
.
implode
(
"
\n
"
,
$rows
)
.
"
\n
</tbody>
\n
</table>"
;
}
else
{
return
'Empty.'
;
}
}
}
framework/yii/debug/views/default/index.php
View file @
1e93fcf2
...
...
@@ -9,8 +9,21 @@ use yii\helpers\Html;
* @var \yii\debug\Panel $activePanel
*/
?>
<?php
foreach
(
$panels
as
$panel
)
:
?>
<?php
echo
Html
::
a
(
Html
::
encode
(
$panel
->
getName
()),
array
(
'debug/default/index'
,
'tag'
=>
$tag
,
'panel'
=>
$panel
->
id
));
?>
<br>
<?php
endforeach
;
?>
<div
class=
"default-index"
>
<div
class=
"span3"
>
<div
class=
"well sidebar-nav"
>
<ul
class=
"nav nav-list"
>
<?php
foreach
(
$panels
as
$panel
)
{
$link
=
Html
::
a
(
Html
::
encode
(
$panel
->
getName
()),
array
(
'debug/default/index'
,
'tag'
=>
$tag
,
'panel'
=>
$panel
->
id
));
echo
Html
::
tag
(
'li'
,
$link
,
array
(
'class'
=>
$panel
===
$activePanel
?
'active'
:
null
));
}
?>
</ul>
</div>
<!--/.well -->
</div>
<!--/span-->
<div
class=
"span9"
>
<?php
echo
$activePanel
->
getDetail
();
?>
</div>
</div>
<?php
echo
$activePanel
->
getDetail
();
?>
framework/yii/debug/views/layouts/main.php
View file @
1e93fcf2
...
...
@@ -4,6 +4,8 @@
* @var string $content
*/
use
yii\helpers\Html
;
Yii
::
$app
->
getView
()
->
registerAssetBundle
(
'yii/bootstrap/responsive'
);
?>
<!DOCTYPE html>
<html>
...
...
@@ -14,7 +16,11 @@ use yii\helpers\Html;
</head>
<body>
<?php
$this
->
beginBody
();
?>
<?php
echo
$content
;
?>
<div
class=
"container-fluid"
>
<div
class=
"row-fluid"
>
<?php
echo
$content
;
?>
</div>
</div>
<?php
$this
->
endBody
();
?>
</body>
<?php
$this
->
endPage
();
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment