Code Igniter: Highlight current page in menu


/ Published in: PHP
Save to your folder(s)

test create new snippet


Copy this code and paste it in your HTML
  1. <ul>
  2. <li class="<?=($this->uri->segment(1)==='alfa')?'active':''?>"><a href="alfa/index" title="Alfa">Alfa</a></li>
  3. <li class="<?=($this->uri->segment(1)==='beta')?'active':''?>"><a href="beta/index" title="Beta">Beta</a></li>
  4. </ul>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.