Highlight current page on navbar
This commit is contained in:
parent
9f674c505a
commit
fe6cad5d73
1 changed files with 13 additions and 2 deletions
15
nav.php
15
nav.php
|
@ -5,10 +5,21 @@
|
|||
</div>
|
||||
<div id="navbar" >
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="Routes.php">Routes</a></li>
|
||||
<li><a href="Stops.php">Stops</a></li>
|
||||
<li class="<?php echo isActive("/Routes.php");?>" ><a href="/Routes.php">Routes</a></li>
|
||||
<li class="<?php echo isActive("/Stops.php");?>"><a href="/Stops.php">Stops</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
|
||||
<?php
|
||||
|
||||
function isActive($url){
|
||||
if ($_SERVER['PHP_SELF'] == $url){
|
||||
return ' active ';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Reference in a new issue