PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of afshin akhgar   Simple PHP Router Library   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Simple PHP Router Library
Route requests to different scripts based on URLs
Author: By
Last change: Update of README.md
Date: 1 year ago
Size: 1,150 bytes
 

Contents

Class file image Download

Folderbase PHP Router!

[AUR]()

A lightweight and simple object oriented PHP Router. Built by Afshin Akhgar- http://www.akhgar.net

Features

  • Static Route
  • Dynamic Route
  • Parameter Support => akhgar.net/param1/a/param2/b
  • Folder and file and subfolders routing
  • Subrouting
  • Parameter sending over url and query String Support
  • Custom 404 handling
  • Works fine in subfolders > Note: > - This Library is under development

<i class="icon-file"></i> Demo

  • First of all get the lib
  • Include it in your php index file
  • Call The router go Method
GLOBAL $includePath;
GLOBAL $assetsUrl;
$includePath = '/';
				
require_once './lib/router.php';
$router = new Router();
return $router->go(array(
	'afshin'=>'examples/afshin.php',
	'/'=>'examples/afshin.php',
	'/sub/:param1/:param2/:param3:/param:4'=>'examples/params.php',
));

<i class="icon-file"></i> Parameter

'/sub/:param1/:param2/:param3:/param:4'=>'examples/params.php'

get Parameters with Array ($parameters)