Show empty data-tables

This commit is contained in:
filp
2013-04-10 15:11:15 +01:00
parent 09cdea1fd1
commit fb7f82bf86
3 changed files with 26 additions and 23 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ class PrettyPageHandler extends Handler
if(php_sapi_name() === 'cli' && !isset($_ENV['whoops-test'])) {
return Handler::DONE;
}
// Get the 'pretty-template.php' template file
// @todo: this can be made more dynamic &&|| cleaned-up
if(!($resources = $this->getResourcesPath())) {
@@ -64,12 +64,12 @@ class PrettyPageHandler extends Handler
'pageStyle' => file_get_contents($cssFile),
'tables' => array(
'Server/Request Data' => $_SERVER,
'GET Data' => $_GET,
'POST Data' => $_POST,
'Files' => $_FILES,
'Cookies' => $_COOKIE,
'Session' => isset($_SESSION) ? $_SESSION: array(),
'Server/Request Data' => $_SERVER,
'Environment Variables' => $_ENV
)
);
+5
View File
@@ -238,6 +238,11 @@ header {
hyphens: auto;
}
.data-table .empty {
color: rgba(0, 0, 0, .3);
font-style: italic;
}
.handler {
padding: 10px;
font: 14px monospace;
+19 -21
View File
@@ -103,29 +103,27 @@
<div class="details">
<div class="data-table-container" id="data-tables">
<?php foreach($v->tables as $label => $data): ?>
<?php if(!empty($data)): ?>
<div class="data-table" id="sg-<?php echo $e($slug($label)) ?>">
<label><?php echo $e($label) ?></label>
<table class="data-table">
<thead>
<div class="data-table" id="sg-<?php echo $e($slug($label)) ?>">
<label><?php echo $e($label) ?></label>
<?php if(!empty($data)): ?>
<table class="data-table">
<thead>
<tr>
<td class="data-table-k">Key</td>
<td class="data-table-v">Value</td>
</tr>
</thead>
<?php foreach($data as $k => $value): ?>
<tr>
<td class="data-table-k">Key</td>
<td class="data-table-v">Value</td>
<td><?php echo $e($k) ?></td>
<td><?php echo $e(print_r($value, true)) ?></td>
</tr>
</thead>
<?php foreach($data as $k => $value): ?>
<tr>
<td><?php echo $e($k) ?></td>
<td><?php echo $e(print_r($value, true)) ?></td>
</tr>
<?php endforeach ?>
</table>
</div>
<?php endif ?>
<?php endforeach ?>
</table>
<?php else: ?>
<span class="empty">empty</span>
<?php endif ?>
</div>
<?php endforeach ?>
</div>