Skip to content

Commit

Permalink
fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 27, 2009
1 parent ca088e1 commit 937a113
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Mojolicious/Lite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,17 @@ Routes can be restricted to specific request methods.
any '/baz' => sub {
my $self = shift;
my $method = $self->req->method;
$self->render(text => "You called /baz with $mthod");
$self->render(text => "You called /baz with $method");
};
All placeholders get compiled to a regex internally, with regex constraints
this process can be easily customized.
# /:something
any '/:something' => [something => qr/\d+/] => sub {
# /*
any '/:bar' => [something => qr/\d+/] => sub {
my $self = shift;
$self->render(text => 'Something: ' . $self->stash('something'));
my $bar = $self->stash('bar');
$self->render(text => "Our :bar placeholder matched $bar");
};
Routes allow default values to make placeholders optional.
Expand Down

0 comments on commit 937a113

Please sign in to comment.