CakePHP Common functionality with models?

52 Views Asked by At

I have 2 controllers (1 for admin, 1 for user) which have basically common functionality. I know you're supposed to use components for common controller functions/code but from what I've read they don't support models.

My functions (for example an edit function that gathers data from 3 models and allows editing of entries) use data from several models so I can't move the logic/functionality in to the model.

What is the way to go?

1

There are 1 best solutions below

0
On

You should not have an "admin" controller. Instead, use admin routing and use admin ACTIONS.

For example

//UsersController

index()
view()
admin_index()
admin_edit()
admin_delete()