Permalink
Browse files

added camel case controller examples

  • Loading branch information...
1 parent 1358146 commit 2d39c625a7bc43bfe3a59232e5208ebf319c190a @kraih committed Oct 10, 2012
Showing with 7 additions and 3 deletions.
  1. +1 −0 Changes
  2. +6 −3 lib/Mojolicious/Guides/Routing.pod
View
@@ -1,6 +1,7 @@
3.46 2012-10-11
- Improved router and renderer to allow camel case controllers.
+ - Improved documentation.
3.45 2012-10-10
- Added multi_accept attribute to Mojo::IOLoop.
@@ -303,12 +303,15 @@ route with all its children.
# /bye -> MyApp::Controller::Foo->bye
$r->route('/bye')
- ->to(namespace => 'MyApp::Controller::Foo', action => 'bye');
+ ->to(namespace => 'MyApp::Controller::Foo::Bar', action => 'bye');
The C<controller> is always appended to the C<namespace> if available.
- # /bye -> MyApp::Controller::Foo->bye
- $r->route('/bye')->to('foo#bye', namespace => 'MyApp::Controller');
+ # /bye -> MyApp::Controller::Foo::Bar->bye
+ $r->route('/bye')->to('foo-bar#bye', namespace => 'MyApp::Controller');
+
+ # /hey -> MyApp::Controller::Foo::Bar->hey
+ $r->route('/hey')->to('Foo::Bar#hey', namespace => 'MyApp::Controller');
You can also change the default namespace for all routes in the application
with the router attribute L<Mojolicious::Routes/"namespace">.

0 comments on commit 2d39c62

Please sign in to comment.