PHP Classes

File: documentor/all_methods_accepted.php

Recommend this page to a friend!
  Classes of Mark Rolich   PHP URL Router Class   documentor/all_methods_accepted.php   Download  
File: documentor/all_methods_accepted.php
Role: Example script
Content type: text/plain
Description: Documention generator files
Class: PHP URL Router Class
Match URLs with routes for controllers and actions
Author: By
Last change: Update of documentor/all_methods_accepted.php
Date: 4 months ago
Size: 329 bytes
 

Contents

Class file image Download
<?php
use Bike\Router;
use
Bike\RouterException;

try {
   
$router = new Router();

   
$router->add('all-methods',
        array(
           
'method' => '*',
           
'route' => '/controller'
       
)
    );

   
$result = $router->match('PUT', '/news');
} catch (
RouterException $e) {
   
$result = $e->getMessage();
}
?>