Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed typo

  • Loading branch information...
commit 937a113d262a5e73e9d63d93cc2d4b3b270adf4d 1 parent ca088e1
sri authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/Mojolicious/Lite.pm
View
9 lib/Mojolicious/Lite.pm
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.