mirror of
https://github.com/Oreolek/debug-toolbar.git
synced 2024-05-17 08:28:14 +03:00
Added more detailed information for current routes (implements #27)
This commit is contained in:
parent
93fbed1360
commit
ce2cf7b239
|
@ -318,12 +318,34 @@
|
||||||
<tr align="left">
|
<tr align="left">
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>name</th>
|
<th>name</th>
|
||||||
|
<th>directory</th>
|
||||||
|
<th>controller</th>
|
||||||
|
<th>action</th>
|
||||||
|
<th>params</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach($routes as $name => $route):
|
<?php foreach($routes as $name => $route):
|
||||||
$class = ($route == Request::initial()->route() ? ' current' : ''); ?>
|
// Toolbar may render on shutdown, so Request::current() is empty
|
||||||
|
$request = Request::current() ? Request::current() : Request::initial();
|
||||||
|
$current = $route == $request->route();
|
||||||
|
$class = ($current ? ' current' : ''); ?>
|
||||||
<tr class="<?php echo Text::alternate('odd','even').$class?>">
|
<tr class="<?php echo Text::alternate('odd','even').$class?>">
|
||||||
<td><?php echo ++$r_counter ?></td>
|
<td><?php echo ++$r_counter ?></td>
|
||||||
<td><?php echo $name ?></td>
|
<td><?php echo $name ?></td>
|
||||||
|
<?php if ($current) : ?>
|
||||||
|
<td><?php echo $request->directory() ?></td>
|
||||||
|
<td><?php echo $request->controller() ?></td>
|
||||||
|
<td><?php echo $request->action() ?></td>
|
||||||
|
<td class="params">
|
||||||
|
<ul>
|
||||||
|
<?php foreach ($request->param() as $k => $v): ?>
|
||||||
|
<li><?php echo $k ?>: <span><?php echo $v ?></li>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<?php else : ?>
|
||||||
|
<td colspan="4"> </td>
|
||||||
|
<?php endif ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue