PHP Classes

File: documentor/slug.php

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

Contents

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

$router->add('article-with-slug',
    array(
       
'method' => 'GET, POST',
       
'route' => '/controller-action(/^slug)',
       
'defaults' => array(
           
'controller' => 'index',
           
'action' => 'index',
           
'format' => 'html'
       
)
    )
);

$result = $router->match('GET', '/news-add/some-article-title');
?>