MVC Framework in PHP

MVC Framework in PHP MVC stands for “Model View and Controller”.The main purpose of MVC in PHP is to separate the Business logic & Application data from the USER interface. Now we will learn the actual working of MVC with examples.


A normal PHP project has the following

PHP code
Html & CSS
Database queries
Functions

When you create a normal project in core PHP, you have some files to keep and manage everything on that. It makes the page to be difficult when you are doing the changes in the files, you have to handle 1K line of code per file. You can not reuse code anywhere else.

See Examples with code  PHP MVC Framework


PHP MVC FRAMEWORK TUTORIAL


It is architecture which provides the structure for files such as model, controller and views part code. 

PHP MVC Based Framework

Controller: It accepts page request and it will page execution, receives data from getting post then give the control to model or views. 

Model: It generates and fetch data from the database and returns to the controller. 

Views: Html that renders at the web browser and has the PHP variables & its value coming from the controller.

More Related Post

  1. How to Create a database in MySql
  2. Create a MySql Database
  3. PHP String Replace
  4. Concrete Class in Java
  5. What is the difference between & and &&?
  6. ) Collections in JAVA

Comments