Reputation: 281
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?
Upvotes: 0
Views: 41
Reputation: 29121
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()
Upvotes: 1