update README

This commit is contained in:
c9s 2014-05-16 19:13:24 +08:00
parent 2a0e120a91
commit 85be3b4dfa

View file

@ -54,11 +54,12 @@ $paths = [
'/blog/post' => [ 'controller' => 'PostController' , 'action' => 'create' , 'method' => 'POST' ] , '/blog/post' => [ 'controller' => 'PostController' , 'action' => 'create' , 'method' => 'POST' ] ,
'/blog' => [ 'controller' => 'BlogController' , 'action' => 'list' , 'method' => 'GET' ] , '/blog' => [ 'controller' => 'BlogController' , 'action' => 'list' , 'method' => 'GET' ] ,
]; ];
$rs = r2_compile_radix($paths, 'persisten-table-id'); $rs = r3_compile($paths, 'persisten-table-id');
$ret = r2_dispatch_radix($rs, '/blog/post/3' ); $ret = r3_dispatch($rs, '/blog/post/3' );
list($complete, $route, $variables) = $ret; list($complete, $route, $variables) = $ret;
list($error, $message) = r2_validate($route); // validate route conditions // matched conditions aren't done yet
list($error, $message) = r3_validate($route); // validate route conditions
if ( $error ) { if ( $error ) {
echo $message; // "Method not allowed", "..."; echo $message; // "Method not allowed", "...";
} }