• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Navigation - highlight current menu tab

Hi all,

With the CI, how can I highlight the current menu tab??

Just like the CI home page.

Is there any easy way to do it with CI, or just code as the normal way?


[eluser]Majd Taby[/eluser]
you could use $this->uri->segment(1) to get the name of the controller, and change styles based on that...

Hi Zaatar,

I am still not quite sure``
could u provide a example please?

$this->uri->segment(1) will get you the current controller name ..

for eg:

url = https://localhost/backup/listing

$this->uri->segment(1) will return u the value 'backup' ..
highlight this 'backup' module use the 1st segment of ur url ..
but i believe there's a better way using CSS ??

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.