PHP Classes

File: Routes/Routes.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   Zest   Routes/Routes.php   Download  
File: Routes/Routes.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Zest
Application to show the use of the Zest framework
Author: By
Last change: Apply fixes from StyleCI
update
Date: 5 years ago
Size: 378 bytes
 

Contents

Class file image Download
<?php

// Add the Routes
$router->get('', 'Home@index');

//for test middleware
$router->get('middlewaretest', 'Home@middlewaretest');

//Test using closure
$router->get('user/{id:[0-9]}', function ($args) {
    echo
'Example route using closure '.$args['id'];
});

//Cache the Routes
$router->cacheRouters();
//Dispatch the request
$router->dispatch($_SERVER['QUERY_STRING']);