PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Adrian M   Basic PHP MVC Basic Model   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Basic PHP MVC Basic Model
Implement MVC applications with a router class
Author: By
Last change:
Date: 3 months ago
Size: 268 bytes
 

Contents

Class file image Download
<?php
include('router/Router.php');

$router = new Router();

$router->addRoute('/home', 'HomeController');
$router->addRoute('/about', 'AboutController');
$router->addRoute('/contact', 'ContactController');

$url = $_SERVER['REQUEST_URI'];


$router->dispatch($url);