backend in MVC pattern ??

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

backend in MVC pattern ??

Post by PHPycho »

Hello forums!!
I had some queries related to MVC pattern.
I used to perform the uri action as:
http://mysite.com/controller/method/params by default, I have used router tweaking for other than default routing.
I would like to hear your views about backend development in MVC pattern.
I had found in cakePHP, action_admin pattern in the same controller file(for both frontend and backend) .
and i dont know what goes in the rest framework.
I would like to know which method is more suitable and flexible for backend development
1> using same controller file for both backend and frontend apps
2> using different mvc folders for backend
3> using different controller for backend and frontend but with same model part
4> else
Please jott down your valueable views/suggestions.
Thanks in advance for the help.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: backend in MVC pattern ??

Post by Christopher »

Either 1 or 2 are ok alternatives.
PHPycho wrote:1> using same controller file for both backend and frontend apps
Here you are granting access within the controller for fine grained Access Control.
PHPycho wrote:2> using different mvc folders for backend
This sounds like you are granting access for an entire module.
PHPycho wrote:3> using different controller for backend and frontend but with same model part
You should do this anyway. Creating Models is one of the best things you can do in my opinion. Reusing them is important. Access Control can be done outside them, or if it needs to be done internally then abstract it to make sense in the context of the Domain Model.
(#10850)
Post Reply