Navigation - highlight current menu tab - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Navigation - highlight current menu tab (/showthread.php?tid=3637) |
Navigation - highlight current menu tab - El Forum - 10-14-2007 [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 Navigation - highlight current menu tab - El Forum - 10-14-2007 [eluser]Majd Taby[/eluser] you could use $this->uri->segment(1) to get the name of the controller, and change styles based on that... Navigation - highlight current menu tab - El Forum - 10-15-2007 [eluser]123XD[/eluser] Hi Zaatar, I am still not quite sure`` could u provide a example please? Thanks Navigation - highlight current menu tab - El Forum - 10-15-2007 [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 ?? |