Created
February 17, 2011 01:38
-
-
Save duellsy/830760 to your computer and use it in GitHub Desktop.
Send user to 404 page if controller exists but method does not (add to MY_Controller.php)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _remap($method) { | |
if (in_array(strtolower($method), array_map('strtolower', get_class_methods($this)))) { | |
$uri = $this->uri->segment_array(); | |
unset($uri[1]); | |
unset($uri[2]); | |
call_user_func_array(array($this, $method), $uri); | |
} | |
else { | |
redirect('404'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment