title: How to put <li class="active"> in navigation menu in Yii?
body: <p>I am working in Yii and am suddenly stuck in this dilemma. The thing is, till this point I was using CMenu and when working with Bootstrap, I was using TbMenu.</p>
  
  <p>However, in this current project, we have created entirely a different menu with lots of new spans and divs inside, so integrating it with the current TbMenu or Cmenu was proving to be very difficult, so we are putting up the menu HTML as is in the main layout. However, now as I visit any view, it should put the appropriate "active" class in the menu list item.</p>
  
  <p>TbNavbar and CMenu were able to achieve this automatically, however I am not able to implement it for my views.</p>
  
  <p>For example : </p>
  
  <p>I have this in as my navbar : </p>
  
  <p>So when I visit "someController/actionSomthing" like so : </p>
  
  <p>www.localhost.com/someController/actionSomthing</p>
  
  <pre><code>&lt;nav&gt;
  &lt;ul id="blah"&gt;
  &lt;li class="active"&gt;&lt;a href ="#" &gt;Something&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href ="#" &gt;Something else&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href ="#" &gt;another something&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <p>So basically when I visit the specific action/Controller : it should put the class = "active" in the li tag.</p>
  
  <p>Please help.</p>
  
  <p>Regards,</p>