[eluser]LAMP Coder[/eluser]
[quote author="jaysonng" date="1247779630"]Hi "LAMP Coder"
do you mind sharing the code(s) on how you solved this?
like what regex in the config file did you use?
what about the _remap?
thanks,[/quote]
I used following code:
I'm sure this can be done in a better way, but this is what I used:
Add following to your routes.php file
Code:
$route['([a-z]+)-([a-z]+)-([a-z]+)(.*)'] = "$1_$2_$3$4";
$route['([a-z]+)-([a-z]+)(.*)'] = "$1_$2$3";
in your controller, all following method:
Code:
function _remap($method)
{
$method = str_replace('-','_',$method);
if(method_exists($this, $method))
{
$this->$method();
}
else
show_404();
}
while defining your methods, use underscores instead of dashes.