Remap function for CodeIgniter
July 26th, 2009 Posted in Bin
I got tired of looking for this code in other projects so I wanted a handy place to keep it.
PHP:
-
<?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.
August 5th, 2010 at 10:59 pm
Thanks man, this remap method save my life!
really thanks!