I'm building a web application and have been banging my head against a brick wall on a certain routing rule.
Here is the URL I am trying to achieve.
localhost/admin/location/123/pages/index
I am using the admin prefix which is working fine by uncommenting the following in app/config/core.php
Configure::write('Routing.prefixes', array('admin'));
'location/123' I want to essentially pass as parameters, so location with id of 123, 'pages' is the controller, 'edit' is the action.
There are other controllers that could replace 'pages' so this needs to be dynamic/wildcard. For example, a location could have pages, posts, users, etc.
Can anyone help me on how to write the Router::connect statement for this? Everything I try from the documentation doesn't seem to work.
Many thanks!
James