Navigation Menu

Skip to content

Commit

Permalink
improved named route documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 16, 2011
1 parent 2c6b15d commit 80c2b3b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

1.99 2011-09-16 00:00:00
1.99 2011-09-17 00:00:00
- Deprecated direct hash access to the flash in
Mojolicious::Controller.
- Added EXPERIMENTAL profile helper.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -1032,8 +1032,8 @@ A L<Mojo::UserAgent> prepared for the current environment.
=head2 C<url_for>
my $url = $c->url_for;
my $url = $c->url_for(controller => 'bar', action => 'baz');
my $url = $c->url_for('named', controller => 'bar', action => 'baz');
my $url = $c->url_for(name => 'sebastian');
my $url = $c->url_for('test', name => 'sebastian');
my $url = $c->url_for('/perldoc');
my $url = $c->url_for('http://mojolicio.us/perldoc');
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -420,11 +420,12 @@ equal to the route itself without non-word characters.
# Generate URL "/foo/bar"
$self->url_for('foobar');

To refer to the current route you can always use the reserved name
C<current>.
To refer to the current route you can use the reserved name C<current> or no
name at all.

# Generate URL for current route
$self->url_for('current');
$self->url_for;

=head2 HTTP Methods

Expand Down

0 comments on commit 80c2b3b

Please sign in to comment.