Author: Abhilash Sharma

The Model-View-Controller (MVC) is an architectural design pattern that seperates an application in three components : first is Model, second is View, third is Controller.

Here is the flow-diagram of MVC :-

 

MVC-basic.svg

 

Diagram shows the single flow layout of data, how it is passed between each components, and show the relationship between each component works.

Model

The Model component corresponds to all the data-related logic that the user works with.The Model is the name given to the permanent storage of the data used in the overall design.

Model represents shape of the data and business logic. It maintains the data of the application. Model objects retrieve and store model state in a database.

One important aspect of the Model is that it’s technically “blind” – that means the model has no connection or knowledge of what happens to the data when it is passed to the View or Controller components.

Model is a data and business logic.

View

View display data using model to the user and also enables them to modify the data.

The View component is used for all the UI logic of the application

The View is where data, requested from the Model, is viewed and its final output is determined.

In web apps built using MVC, the View is the part of the system where the HTML is generated and displayed.

View is a user interface.

Controller

Controller act as an interface between Model and view components to precess all the incoming requests.

It handles the users request.User interact with View, which in-tern raises appropriate URL request, this request will be handled by a controller.

Controller is a request handler.

Read More What is MVC ?

PHP Web Development