![]() |
_remap() acting up - 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: _remap() acting up (/showthread.php?tid=29985) |
_remap() acting up - El Forum - 04-28-2010 [eluser]Samuurai[/eluser] Hi everyone, It's probably not acting up at all.. I probably just don't know the correct usage. Here's my code: Code: function _remap() I tried first ignoring them (see the long if statement). Then I tried the first if statement..both to no avail. Can anyone spot any obvious flaws in my code? Thanks _remap() acting up - El Forum - 04-28-2010 [eluser]mah0001[/eluser] From Docs: If your controller contains a function named _remap(), it will always get called regardless of what your URI contains. It overrides the normal behavior in which the URI determines which function is called, allowing you to define your own function routing rules. Try this, you need to handle all cases in the remap: Code: function _remap() _remap() acting up - El Forum - 04-28-2010 [eluser]charlie spider[/eluser] I use remap this exact same way but you will find that a switch will run better than a bunch of IF statements try: Code: function _remap() _remap() acting up - El Forum - 04-29-2010 [eluser]Samuurai[/eluser] That worked an absolute treat! I had to change Code: if ( isset( $this->uri->segment(3) ) ) Code: if ( $this->uri->segment(3) ) Thanks a lot both of you. |