Simpler way to remove link [uri->segment()] - 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: Simpler way to remove link [uri->segment()] (/showthread.php?tid=38275) |
Simpler way to remove link [uri->segment()] - El Forum - 02-03-2011 [eluser]carvingCode[/eluser] I want to remove the link on the current page. The code blow allows me to do that, but seems a bit excessive, especially as I build out the rest of the options (approx 20). Is there a simpler way to do this? Code: if ($this->uri->segment(2) == 'add_section') { TIA Randy Simpler way to remove link [uri->segment()] - El Forum - 02-03-2011 [eluser]cideveloper[/eluser] Using the below code you just need to add to the $data array your uri segments and text and it will generate you list items Code: $data = array ( Simpler way to remove link [uri->segment()] - El Forum - 02-04-2011 [eluser]carvingCode[/eluser] Thanks. Indeed a simpler way. I made a slight modification to handle a 'controller/function' type of menu call. Code: function show_menu($data_array, $first_uri_segment, $second_uri_segment) { I placed the function in a custom library in my project, hence the 'cc_functions' in the function call statement. Thanks! Randy |