I'm trying to figure out the best way to organize controllers based on
user roles and could use some advice. I know there are experienced
people here who have had to deal with this already :-).
I have controller folders setup as:
member/
manager/
admin/
They all deal with products and I don't want to have one
ProductController at the controllers/ level that has all the functions
(view a product, add a product, delete a product). This is the way I'd
like to set it up:
member/product_controller - view()
manager/product_controller - add()
admin/product_controller - delete()
What is the best way to accomplish this division of controller
functionality? I know that I can modify the paths for controllers in
bootstrap.php, but if I have the same controller under multiple
locations, which one will cake find? The first in the list I assume?
The other solution I was thinking of is to name the controllers
differently, but is this the best way to do it?
mem_product_controller
mgr_product_controller
adm_product_controller
I'm new to CakePHP ... I'm not sure if this is doable with cake's MVC
naming conventions.
Thanks for your help!