Navigation - highlight current menu tab |
[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
[eluser]Majd Taby[/eluser]
you could use $this->uri->segment(1) to get the name of the controller, and change styles based on that...
[eluser]123XD[/eluser]
Hi Zaatar, I am still not quite sure`` could u provide a example please? Thanks
[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 ?? |
Welcome Guest, Not a member yet? Register Sign In |