Skip to content

Commit

Permalink
regenerate README.mkdn
Browse files Browse the repository at this point in the history
  • Loading branch information
tokuhirom committed Mar 18, 2010
1 parent 8ac43f5 commit ef95f8b
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions README.mkdn
Expand Up @@ -52,35 +52,15 @@ This method returns a plain hashref.Example return value as following:

Will return None if no valid match is found.

- $router->resource($controller, $resource_name, \%opt)

Router::Simple makes it easy to configure RESTful web services.
__resource__ creates a set of add/modify/delete routes conforming to the Atom publishing protocol.

This method makes the map as following:

$router->resource('Article', 'article', {collection_name => 'articles'})

articles POST /articles
articles GET /articles
formatted_articles GET /articles.{format}
new_articles GET /articles/new
formatted_new_articles GET /articles/new.{format}
PUT /articles/{id}
DELETE /articles/{id}
formatted_edit_articles GET /articles/{id}.{format}/edit
edit_articles GET /articles/{id}/edit
formatted_article GET /articles/{id}.{format}
article GET /articles/{id}

- $router->url_for($anchor, \%opts)

generate path string from rule named $anchor.

You must pass the each parameters to \%opts.

my $router = Router::Simple->new();
$router->resource('Article', 'article');
$router->connect('articles', '/article', {controller => 'Article', action => 'index'});
$router->connect('edit_articles', '/article/{id}', {controller => 'Article', action => 'edit'});
$router->url_for('articles'); # => /articles
$router->url_for('edit_articles', {id => 3}); # => /articles/3/edit

Expand Down Expand Up @@ -108,7 +88,7 @@ Router::Simple is inspired by L<routes.py|http://routes.groovie.org/>.

[Path::Router](http://search.cpan.org/search?mode=module&query=Path::Router) is heavy.It depend to [Moose](http://search.cpan.org/search?mode=module&query=Moose).

[HTTP::Router](http://search.cpan.org/search?mode=module&query=HTTP::Router) is heavy, too.It depend to Mouse, and more.
[HTTP::Router](http://search.cpan.org/search?mode=module&query=HTTP::Router) has many deps.It doesn't well documented.

[HTTPx::Dispatcher](http://search.cpan.org/search?mode=module&query=HTTPx::Dispatcher) is my old one.It does not provides OOish interface.

Expand Down

0 comments on commit ef95f8b

Please sign in to comment.