Created
January 20, 2010 22:53
-
-
Save sharifulin/282378 to your computer and use it in GitHub Desktop.
Mojo: bug in routes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use lib qw(lib ../mojo/lib); | |
$ENV{MOJO_APP} ||= 'App'; | |
use Mojolicious::Commands; Mojolicious::Commands->start; | |
package App; | |
use strict; | |
use base 'Mojolicious'; | |
sub startup { | |
my $self = shift; | |
my $r = $self->routes; | |
$r->route('/test' )->to('test#show'); # OK | |
$r->route('/test1')->to(controller => 'test-test', action => 'show'); # OK | |
$r->route('/test2')->to('test-test#show'); # ERROR | |
} | |
1; | |
package App::Test; | |
use strict; | |
use base 'Mojolicious::Controller'; | |
sub show { shift->render_text('Test!') } | |
1; | |
package App::Test::Test; | |
use strict; | |
use base 'Mojolicious::Controller'; | |
sub show { shift->render_text('Test Test!') } | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment