Exemplo n.º 1
0
 function test()
 {
     $routes = new Roller\RouteSet();
     $routes->add('/blog/:year/:month', function () {
         return 'Yes';
     }, array('year' => '\\d'));
     $routes->compile();
     $dumper = new Roller\Dumper\ConsoleDumper();
     ob_start();
     $dumper->dump($routes);
     ob_end_clean();
 }
Exemplo n.º 2
0
<?php

require 'tests/bootstrap.php';
$routes = new Roller\RouteSet();
$routes->add('/blog/:year/:month', function ($year, $month) {
    return 'Yes';
}, array('year' => '\\d+'));
$routes->add('/blog/:id', function ($id) {
    return $id;
}, array('id' => '\\d+'));
$routes->compile();
$dumper = new Roller\Dumper\ConsoleDumper();
$dumper->dump($routes);