Skip to content

Commit

Permalink
document new behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
vti committed Feb 21, 2014
1 parent 0da9c83 commit 33a0701
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Routes/Tiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ L<Routes::Tiny> aims to be easy to use in any web framework.
It is possible to specify a constraint that a placeholder must match using a
normal Perl regular expression.
Constraints can be passed as array references:
$routes->add_route('/articles/:action',
constraints => {action => [qw/add update/]});
$match = $routes->match('/articles/add'); # Routes::Tiny::Match object
$match = $routes->match('/articles/delete'); # undef
=head2 C<Optional placeholders>
$routes->add_route('/admin/:service(/:action)?', defaults => {action => 'list'});
Expand Down

0 comments on commit 33a0701

Please sign in to comment.