In my Cakephp application i wish to have the following url:
admin/users/:action
I want the UsersController to reside in an sub-folder of Controllers named 'admin'. I know how to implement this with Cake 3 and 4 but in this case I am working with a legacy Cake2 project. I have read the chapter on the router in the Cake2 book, but it seems to deal with this by prefixing controller actions with "admin" using a single main controller.
That's not what I need, I am looking for the following:
Controllers
- [Admin]
- UsersController
- UsersContrller
That is - two controller and the sub-folder.
I can match the route as follows, but I can't figure out the parameters to use:
Router::connect(
'/integrations/foo/:controller/:action/*',
[]
);
Where 'integrations' is my plugin and 'foo' is the sub-folder. I am having doubts if this is actually possible in Cake2. I found an old question from 2013 that says that sub-directories for controllers is no longer supported, but I am not sure if that is a valid statement.
CakePHP controllers and models in subdirectory
Might this need to be done with a redirect at the server level?