Skip to content

Commit

Permalink
show how to generate absolute URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 21, 2013
1 parent 34b6434 commit fc254e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -465,6 +465,9 @@ L<Mojolicious::Controller/"url_for"> for this.
# Generate URL "/foo/sebastian" for route "test"
my $url = $self->url_for('test', name => 'sebastian');

# Generate URL "http://127.0.0.1:3000/foo/sebastian" for route "test"
my $url = $self->url_for('test', name => 'sebastian')->to_abs;

Nameless routes get an automatically generated one assigned that is simply
equal to the route itself without non-word characters.

Expand Down

0 comments on commit fc254e0

Please sign in to comment.