A term MVC is little bit confusing to newly developers. Now I am describing very easy way and let you know how to create any application MVC .MVC is global term for any language, it’s not depended to any technology. MVC is a way of separation to three layers model, view, controller of application. The flow of three layer is below.
View >> Controller>> Model
Checkout other recommended Tutorials,
- Best PHP Framework for 2015 – PHP MVC Framework Trends
- Best PHP framework in 2013
- Top 6 RESTful API Frameworks for PHP
- Simple MVC architecture with an example
A model is an object representing data. Model conations all functions and objects which is responsible to database related operation. A model can have more than one view. It’s used to get data from database, validation of existing records, set data into database etc. it all about database related operation.
View is responsible to manage graphics/textual display to user. User interacts with controller and controller response through view that is given through the controller as response. It contains all HTML and Front-end related information.
Controller is bone of MVC application. It is responsible to takes input from View and sends to Model if needed and again send response to view to display useful information to user. Its contains all operation level information and a key player between view and model. It also responsible to render view and call model method and get response from model method and pass to view file.