Reputation: 71
I'm studying MVC a little but i don't understand where the "admin control panel" fits in the MVC structure. I'm working with PHP. Maybe anyone can give me some ideas?
Upvotes: 1
Views: 2894
Reputation: 1678
An Admin control panel is just another interface to your models. You just use the same models as you use for your app and you create methods/actions in your controller that are only accessible by admin users (which in their turn might use some specific admin-only methods in the associated model).
An example with a blog would be that you have a model called Post
which contains your blogposts. In your PostsController
you've got three methods: view()
, add()
and delete()
. Regular users only have access to the view()
method and it's associated view, whereas admin users can also use the other two methods and their associated views.
How you setup these access rights depends on the MVC framework you're using, but one solution is to use an Access Control List or ACL.
Upvotes: 2
Reputation: 62402
In the "MVC" structure, what you are calling the "admin control panel", is just another set of models, views, and controllers accessible by someone with administrative privileges.
Conceptually it is no different then the set of models, views, and controllers serving up content for public viewing.
This question doesn't make sense logically, similar to this question.
"I've been studying cellular structure, and want to know how a human being fits into a cell's organization"
Upvotes: 6