I am trying to get the following URLs for my API (I am using Codeigniter and Phil Sturgeon REST server library ):
/players -> refers to index method in the players controller /players/rookies -> refers to rookies method in the players controller
I do not want the url to have a trailing "index"
/players/index
This is not a problem when I define the routes as follows:
$route['players'] = 'players/index';
Everything works as expected.
My problem is that I need additional URL segments, for example:
/players/rookies/limit/10/offset/5/key/abcdef
The above example works, but the following:
/players/limit/10/offset/5/key/abcdef
I get the following error: {"status":false,"error":"Unknown method."} Obviously, there is no limit method in my controller.
How do I configure the route.php configuration file so that these URLs work correctly?
Any help is much appreciated!
source share