Hello World Example using PHP MVC

MODEL:It is a class file which contains the Database connectivity queries inside it.

CONTROLLER:This file access the methods and variables declared.

VIEW:It contains all the html and view page.

In Controller create a file named "hello.php". This file will be saved in the Controller folder.


class Hello extends Controller {
function __construct() {
function index() {

Create a file index.php and place inside views folder.


<!DOCTYPE html>
<title>Hello World</title>
<p>Hello World!!</p>

Now run the file in any browser: http://localhost/mvc/hello/index