![]() |
parse url, class=active - 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: parse url, class=active (/showthread.php?tid=37813) |
parse url, class=active - El Forum - 01-21-2011 [eluser]benfike[/eluser] Hi! Code: <?php $page = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); ?> So if $controller = admin/overview then set li class="active".... It works fine, but it dont work when there is a function for overview controller, example: add, modify etc. what can I do? or there is a easiest way to make something like this? Sorry for my english; parse url, class=active - El Forum - 01-21-2011 [eluser]Victor Michnowicz[/eluser] A better way to get the current class and method: Code: $this->router->class; parse url, class=active - El Forum - 01-23-2011 [eluser]benfike[/eluser] thanks ![]() |