MVC(model-view-controller) Architecture aims to separate business logic from user interface considerations, so that developers can more easily change each part without affecting the other. In MVC, the model represents the information (the data) and the business rules; the view contains elements of the user interface such as text, form inputs; and the controller manages the communication between the model and the view.
Work Flow of MVC Architecture:
The view contains the html code which is interface for communication with the users which is loaded by the controller to receive the user inputs.The controller which in turn sends the input to the model to process with database and the model will send the data processed .to the controller and is displayed to the view.There are helper classes and plugins in all the framework which makes the development Faster with less code.
Advantages of MVC Architecture:
- Most of the Frameworks speed up the development process by automatically creating functionality like CRUD so that the developer can focus on creativity than base structure.
- These frameworks have inbuilt Core Library, hence coding gets lighter as compared to the traditional way of PHP coding.
- PHP frameworks have their own specific debugging methodologies.
- All top PHP frameworks come with certain Libraries and Helpers, that help you with:
- Form Validation
- Input/output
- Database Abstration
- Session and cookie Handling
- Email,Calendar,Pagination etc
5. Security : In PHP you can already find many input and output filtering functions to protect your website against certain attacks.Instead of including it manually with a framework,most of the work can be done for you automatically.
1 Comment
Sahil
June 26, 2014the way I learned MVC was using the Models, Controllers and View foedlrs and data access being separate.To me, this example is very confusing, since in your Repository, you have ListEmployeesViewModel there is no model for the controller in the model folder. I have a very hard time distinguishing how the parts all fit together.