Welcome Guest, Not a member yet? Register   Sign In
Navigation - highlight current menu tab
#1

[eluser]123XD[/eluser]
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?

Cheers
#2

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

[eluser]123XD[/eluser]
Hi Zaatar,

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

[eluser]cinewbie81[/eluser]
$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 ??




Theme © iAndrew 2016 - Forum software by © MyBB