Skip to content

Commit

Permalink
bridges are more important than waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 17, 2011
1 parent 72644e0 commit e543441
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -472,22 +472,10 @@ pass.
$r->route('/bye')->via('GET', 'POST')
->to(controller => 'foo', action => 'bye');

=head2 Waypoints

Waypoints are very similar to normal nested routes but can match even if they
have children.

# /foo -> {controller => 'foo', action => 'baz'}
# /foo/bar -> {controller => 'foo', action => 'bar'}
my $foo = $r->waypoint('/foo')->to(controller => 'foo', action => 'baz');
$foo->route('/bar')->to(action => 'bar');

All children will be ignored if a waypoint matches.

=head2 Bridges

Bridges unlike nested routes and waypoints always match and result in
additional dispatch cycles.
Bridges unlike nested routes always match and result in additional dispatch
cycles.

# /foo -> undef
# /foo/bar -> {controller => 'foo', action => 'baz'}
Expand All @@ -513,6 +501,18 @@ will be broken, this makes bridges a very powerful tool for authentication.
});
$foo->route('/bar')->to(controller => 'foo', action => 'bar');

=head2 Waypoints

Waypoints are very similar to normal nested routes but can match even if they
have children.

# /foo -> {controller => 'foo', action => 'baz'}
# /foo/bar -> {controller => 'foo', action => 'bar'}
my $foo = $r->waypoint('/foo')->to(controller => 'foo', action => 'baz');
$foo->route('/bar')->to(action => 'bar');

All children will be ignored if a waypoint matches.

=head2 Mojolicious::Lite routes

L<Mojolicious::Lite> routes are in fact just a small convenience layer around
Expand Down

0 comments on commit e543441

Please sign in to comment.