I'm creating dynamic menu. I wanted to highlight the menu once it is selected. We use php. just need to figure out how to append the class active to the current page. Can anyone help me with this?
<div id="sidebar-wrapper" class="sidebar-toggle">
<ul class="sidebar-nav">
<?php
$i=1;
if(count($shipments) > 0)
{
foreach($shipments as $row)
{
$shipment_id = $row['id'];
$containerdest = $row['no']."-".$row['destination'];
?>
<li id="shipment<?php echo $shipment_id; ?>"><a href="<?php echo site_url("users/get_details/$shipment_id");?>" id="display<?php echo $shipment_id; ?>"><?php echo $containerdest; ?></a>
</li>
<?php $i++;
}
} ?>
<li>
<a href="<?php echo base_url();?>index.php/users/logout">Logout</a>
</li>
</ul>
</div>
</div>