So I am working on an application which will have three different interfaces: a store, an admin page and a user page.
Authorisation is handled externally, based on URLs. So /my_app/admin could be restricted to admins, /my_app/store to the tablet in the shop and /my_app/users to anyone properly logged in.
With CakePHP these urls could be realised by having only three controllers with those names. However, the admin page for instance will have many models to work with, so having all the actions for different models in one controller is not convenient at all. So, the question:
Is it possible to ‘group’ controllers with a URL? e.g. /my_app/group_name/controller1/action1/argument and /my_app/group_name/controller2/action5/argument.
The controller/action -type URLs which CakePHP creates by default can and should be overwritten to better fit your app, you definitely shouldn’t try to fit your controller methods in that structure.
Prefix routing is indeed the way to go, it accomplishes exactly what I was looking for.
I initially refrained from using routes, because it seems it only add extra links. e.g. connection “/admin/*” with “/products/index” would only add a shortcut, it does not block direct usage of “/products/index”,right?
However, in the scenario I described in the first post the URL will form the bases of the authorisation system that we use. So via the routed URL someone would be allowed, but not via the unaltered URL.
(Just to be clear, prefixed routing does not have this issue and my questions has been answered.)