Welcome Guest, Not a member yet? Register   Sign In
How to Process Params of a Route Callback Function?
#7

(07-07-2016, 08:02 AM)mwhitney Wrote: Another option might be simpler, though. You should be able to do something like this:

PHP Code:
$route['controller/specific_method/(:any)'] = 'controller/specific_method/$1';
$route['controller/(:any)/(:any)'] = 'controller/index/$1/$2';
$route['controller/(:any)'] = 'controller/index/$1'

As long as the 'controller/specific_method' route is defined first, it should be resolved before the 'controller/(:any)' routes.

Thank you for the answer! I had to go with the simpler option as the callback function just refused to work as expected even if the 2nd param had a default empty value.
Reply


Messages In This Thread
RE: How to Process Params of a Route Callback Function? - by grins - 07-07-2016, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB