Register now or log in to join your professional community.
Makes maintaining and developing the project a lot easier
Thank you for your question,
The combination of Mr Obada and Mr Goran´s answers highlights most advantages.
The answer can relate to MVC in general, it's not PHP specific. An advantage could be that your code is easier to understand, maintain and extend because you have decoupled Models - that are database objects, from Controllers - that contain all your programmatic logic and algorithms and Views that are used to present final results to a user, containing all front end scripts like CSS and JavaScript.
there is 3 modules of MVC pattern:
which you have 3 different parts that allows you to mange each one separately. moreover you can find it in Drupal, Joomla, Wordpress, ...etc.
it gives you an easy developing method by separating three component (model, controller, view) in a very strong logical way and more important it offer a standard that all can follow.
When you setup a PHP Framework, it already has a certain folder structure. It is expected from you to follow the same standards and keep everything organized in a certain way. Once you get used to this model, you will never want to go back. Unfortunately for some command line champions that still use vi, this can be a challenge. You will need to work with more files, that are smaller in size. But when you use a decent modern code editor or an IDE, it will be a breeze to browse through your application code and find what you need, quickly.
· Easier for Development
If Programmers are working as a team, or individually They can work on different sections like one programmer for Views, one for Controllers and one for Model.
· Easy For Modifications
If we develop a project using MVC Architecture , we can change the views without affecting the data from models
· Easy for Formatting Data
As the output datas are coming without any formatting ,it is easy for formatting the data for different type of views
· Multiple Views
Using MVC we can create multiple views for a single model.
If you are using PHP, the whole MVC notion has to be followed within PHP (or any other server-side technology). HTML, CSS and Javascript will be part of the presentation in the view (client-side) but will have nothing to do directly with the MVC structure. MySQL will feature somewhere in the Model.You can find many PHP frameworks which use MVC pattern. For e.g. CodeIgniter,CakePHP, Symfony, etc. If you any of them, all you have to do is follow their conventions to realize your website using MVC.