/ Published in: PHP
test create new snippet
Expand |
Embed | Plain Text
<ul> <li class="<?=($this->uri->segment(1)==='alfa')?'active':''?>"><a href="alfa/index" title="Alfa">Alfa</a></li> <li class="<?=($this->uri->segment(1)==='beta')?'active':''?>"><a href="beta/index" title="Beta">Beta</a></li> </ul>
Comments
Subscribe to comments
You need to login to post a comment.

I think you should add strtolower() for the $this->uri->segment(1) part. In case the uri becomes "ALFA/index", your highlighting will otherwise become broken.