PHP Classes

File: documentor/optional_parameters.php

Recommend this page to a friend!
  Classes of Mark Rolich   PHP URL Router Class   documentor/optional_parameters.php   Download  
File: documentor/optional_parameters.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/optional_parameters.php
Date: 4 months ago
Size: 273 bytes
 

Contents

Class file image Download
<?php
$router
= new Bike\Router();

$router->add('optional-controller-and-action',
    array(
       
'method' => 'GET, POST',
       
'route' => '/(controller(/action))'
   
)
);

$result1 = $router->match('GET', '/news/add');
$result2 = $router->match('GET', '/news');
?>