Skip to content

Instantly share code, notes, and snippets.

@kylejohnson
Last active December 28, 2015 10:49
Show Gist options
  • Select an option

  • Save kylejohnson/7489241 to your computer and use it in GitHub Desktop.

Select an option

Save kylejohnson/7489241 to your computer and use it in GitHub Desktop.
<ul class="nav nav-pills">
<?php
$views = array(
'Monitors' => 'glyphicon glyphicon-facetime-video',
'Events' => 'glyphicon glyphicon-film',
'Config' => 'glyphicon glyphicon-list',
'Logs' => 'glyphicon glyphicon-info-sign',
'Zones' => 'glyphicon glyphicon-picture'
);
$title = $this->fetch('title');
foreach ($views as $viewname => $class) {
if ($viewname == $title) {
echo '<li class="active">';
} else {
echo '<li>';
}
echo $this->Html->link("<span class=\"$class\"></span> " . $viewname, array('controller' => $viewname, 'action' => 'index'), array('escape' => false));
echo '</li>';
}
?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment