Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the advantage of developing PHP project using MVC architecture ?

user-image
Question added by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date Posted: 2016/11/24
Harif Aakkantavita
by Harif Aakkantavita , Magento / Laravel Developer , Rhinos Groupe

Reusability,reliability,security

Harran Ali
by Harran Ali , Creator , GoCondor (Golang open source project)

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.

Goran Radosevic
by Goran Radosevic , Owner , Freelance

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.

obada saada
by obada saada , ٍSoftware Developer , Al-Noor for powder Coatings

there is 3 modules of MVC pattern:

  • Model: used to store and retrieve the data from database usually.
  • View: used to display the data that provided by model in specific format
  • controller: handles both Models and views to make them work together, the controller gets the request from the client then invoke the model to perform requested operations and send the data to the view, finally view format the received data to show it to the user.

which you have 3 different parts that allows you to mange each one separately. moreover you can find it in Drupal, Joomla, Wordpress, ...etc.

Moosa Bukhamsin
by Moosa Bukhamsin , Chief Technology Officer , FUDEX ESB

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. 

Rasheed ul Hasan
by Rasheed ul Hasan , Web Developer , Devicebee

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.

Using MVC principle lets the coding easier, reusable and design template are separate from coding.

Sajan John
by Sajan John , Magento Developer , MERLIN DIGITAL GENERAL TRADING LLC

·         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.

alaa liswe
by alaa liswe , ِAdministrative Assistant , Arab Open University

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,CakePHPSymfony, etc. If you any of them, all you have to do is follow their conventions to realize your website using MVC.

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.