mirror of
https://github.com/filp/whoops.git
synced 2026-09-16 12:46:19 +00:00
Show empty data-tables
This commit is contained in:
@@ -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
|
||||
)
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user