Remap function for CodeIgniter
I got tired of looking for this code in other projects so I wanted a handy place to keep it.
-
<?php
-
function _remap($method)
-
{
-
$this->$method($this->uri->segment(3));
-
} else {
-
$this->index($method);
-
}
-
}
-
?>
In case you're wondering, this function is a reserved method in CodeIgniter controllers that will allow for a dynamic method name to be passed into the URL. Docs on it are here: codeigniter.com/user_guide/general/controllers.html#remapping.
