PHP Classes

File: documentor/query_string.php

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

Contents

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

$router->add('query-string',
    array(
       
'method' => 'GET, POST',
       
'route' => '/(controller(/action))',
       
'defaults' => array(
           
'controller' => 'index',
           
'action' => 'index'
       
)
    )
);

$result = $router->match('GET', '/news/add?slug=some-slug&id=12');
?>