I currently have this in my CodeIgniter routes file.
It maps anything with a URI api/controller/function
to controller/api_function
.
$route['api/(:any)/(:any)/(:any)/(:any)/(:any)/(:any)'] = '$1/api_$2/$3/$4/$5/$6';
$route['api/(:any)/(:any)/(:any)/(:any)/(:any)'] = '$1/api_$2/$3/$4/$5';
$route['api/(:any)/(:any)/(:any)/(:any)'] = '$1/api_$2/$3/$4';
$route['api/(:any)/(:any)/(:any)'] = '$1/api_$2/$3';
$route['api/(:any)/(:any)'] = '$1/api_$2';
As you can see, this isn't very efficient. I need a different routes line depending on the number of parameters supplied. Is there a way to automatically pass all parameters along? So hypothetically, I'm looking for something like...
$route['api/(:any)/(:any)/unlimited parameters'] = '$1/api_$2/unlimited parameters';
Thanks!