Added more detailed information for current routes (implements #27)

This commit is contained in:
biakaveron 2013-08-16 10:28:44 +04:00
parent 93fbed1360
commit ce2cf7b239
1 changed files with 23 additions and 1 deletions

View File

@ -318,12 +318,34 @@
<tr align="left">
<th>#</th>
<th>name</th>
<th>directory</th>
<th>controller</th>
<th>action</th>
<th>params</th>
</tr>
<?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?>">
<td><?php echo ++$r_counter ?></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">&nbsp</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</table>