tweak example
This commit is contained in:
10
README.pod
10
README.pod
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user