tweak example

This commit is contained in:
Graham Ollis
2013-08-08 09:05:58 -04:00
parent e541ac92b7
commit 90e2562862
3 changed files with 4 additions and 16 deletions

View File

@@ -46,16 +46,10 @@ L<Mojolicious> example:
package MyApp;
use Mojo::Base 'Mojolicious';
# This method will run once at server start
sub startup {
my $self = shift;
$self->plugin('tt_renderer');
# Router
my $r = $self->routes;
# Normal route to controller
$r->get('/')->to('example#welcome');
}
@@ -68,9 +62,9 @@ L<Mojolicious> example:
sub welcome {
my $self = shift;
# Render template "example/welcome.html.ep" with message
# Render template "example/welcome.html.tt" with message
$self->render(
message => 'Welcome to the Mojolicious real-time web framework!');
message => 'Looks like your TtRenderer is working!');
}
1;

View File

@@ -1,16 +1,10 @@
package MyApp;
use Mojo::Base 'Mojolicious';
# This method will run once at server start
sub startup {
my $self = shift;
$self->plugin('tt_renderer');
# Router
my $r = $self->routes;
# Normal route to controller
$r->get('/')->to('example#welcome');
}

View File

@@ -5,9 +5,9 @@ use Mojo::Base 'Mojolicious::Controller';
sub welcome {
my $self = shift;
# Render template "example/welcome.html.ep" with message
# Render template "example/welcome.html.tt" with message
$self->render(
message => 'Welcome to the Mojolicious real-time web framework!');
message => 'Looks like your TtRenderer is working!');
}
1;