title: how to make a dynamic sidebar active on a clicking
body: <p>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?</p>
  
  <pre><code>  &lt;div id="sidebar-wrapper" class="sidebar-toggle"&gt;
      &lt;ul class="sidebar-nav"&gt;
        &lt;?php  
  
        $i=1;
      if(count($shipments) &gt; 0) 
        {  
        foreach($shipments as $row) 
          {
          $shipment_id = $row['id'];
          $containerdest = $row['no']."-".$row['destination'];
  
            ?&gt;
          &lt;li id="shipment&lt;?php echo $shipment_id; ?&gt;"&gt;&lt;a href="&lt;?php echo site_url("users/get_details/$shipment_id");?&gt;" id="display&lt;?php echo $shipment_id; ?&gt;"&gt;&lt;?php echo $containerdest; ?&gt;&lt;/a&gt;
          &lt;/li&gt;
          &lt;?php $i++; 
          } 
        } ?&gt;
  
  
          &lt;li&gt;
              &lt;a href="&lt;?php echo base_url();?&gt;index.php/users/logout"&gt;Logout&lt;/a&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>