Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gitignore

  • Loading branch information...
commit 17086e59ef1f433cc251a006b08f1b49e4c1a239 1 parent 03c7271
@c9s authored
Showing with 14 additions and 7 deletions.
  1. +2 −0  .gitignore
  2. +12 −7 README.md
View
2  .gitignore
@@ -0,0 +1,2 @@
+.onion
+vendor
View
19 README.md
@@ -48,8 +48,8 @@ To add a new route with requirement:
Meta Attributes
---------------
-meta attributes is started with ':' character. currently, Roller supports:
-`:method`, `:default`, `:requirement`, `:post`, `:get` attributes.
+meta attributes is started without ':' prefix. currently, Roller supports:
+`method`, `default`, `requirement`, `post`, `get` attributes.
To add a new route with requirement and default value:
@@ -74,6 +74,7 @@ To add a new route with request method (like POST method):
Dispatch
--------
+
To dispatch path:
$r = $router->dispatch( $_SERVER['PATH_INFO'] );
@@ -85,7 +86,6 @@ To evalulate response content:
else
die('page not found.');
-
Mount paths
-----------
@@ -118,10 +118,15 @@ To enable file cache:
RESTful plugin:
-
- $restfulPlugin = new Roller\Plugin\RESTful( );
- $restfulPlugin->handler( );
-
+ $restful = new Roller\Plugin\RESTful( array(
+ 'prefix' => '/restful',
+ ));
+ $restful->mount = function() {
+ $method = $_SERVER['REQUEST_METHOD'];
+ $routes = new RouteSet;
+ $routes->add( '/:resource_id/:id' );
+ };
+ $router->addPlugin( $restful );
Hacking
-------

0 comments on commit 17086e5

Please sign in to comment.
Something went wrong with that request. Please try again.