PHP Classes

File: example/index.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   Zest PHP Router Library   example/index.php   Download  
File: example/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Zest PHP Router Library
Configure URL routes and dispatch HTTP requests
Author: By
Last change:
Date: 3 years ago
Size: 729 bytes


Class file image Download

use Lablnet\ZestRouter;


$router = new ZestRouter;

//Namespaces uses for loading controllers olny

$router->get('', function () {
'Example route using closure';
$router->add('', function () {
    echo 'Example route using closure';
 $router->get('test',['controller' => 'Home', 'action' => 'index']);
  $router->add('test',['controller' => 'Home', 'action' => 'index'],'GET');


//Dispatch/Process the request automatically for mannually dispatch request take a look at Process Request section