PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of afshin akhgar   Simple PHP Router Library   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple PHP Router Library
Route requests to different scripts based on URLs
Author: By
Last change: Update of index.php
Date: 2 years ago
Size: 532 bytes
 

Contents

Class file image Download
<?php
/**
 * Created by PhpStorm.
 * User: akhgar-af
 * Date: 8/9/2016
 * Time: 10:46 AM
 */

GLOBAL $includePath;
GLOBAL
$assetsUrl;
$includePath = '/';
               
require_once
'./lib/router.php';
$router = new Router();
return
$router->go(array(
   
'afshin'=>'examples/afshin.php',
   
'/'=>'examples/afshin.php',
   
'test'=> 'examples/test.php',
   
'sub/iran' => 'examples/sub/iran.php',
   
'sub/subsub/module' => 'examples/sub/subsub/module/module.php',
   
'sub/subsub/param/:param1/:param2/:param3' => 'examples/sub/subsub/module/param.php',
));