tweak example
This commit is contained in:
1 parent
e541ac92b7
commit
90e2562862
3 files changed
+4
-16
No files matched your search
+2
-8
@@ -46,16 +46,10 @@ L<Mojolicious> example:
|
|||||||
package MyApp;
|
package MyApp;
|
||||||
use Mojo::Base 'Mojolicious';
|
use Mojo::Base 'Mojolicious';
|
||||||
|
|
||||||
# This method will run once at server start
|
|
||||||
sub startup {
|
sub startup {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
$self->plugin('tt_renderer');
|
$self->plugin('tt_renderer');
|
||||||
|
|
||||||
# Router
|
|
||||||
my $r = $self->routes;
|
my $r = $self->routes;
|
||||||
|
|
||||||
# Normal route to controller
|
|
||||||
$r->get('/')->to('example#welcome');
|
$r->get('/')->to('example#welcome');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,9 +62,9 @@ L<Mojolicious> example:
|
|||||||
sub welcome {
|
sub welcome {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
# Render template "example/welcome.html.ep" with message
|
# Render template "example/welcome.html.tt" with message
|
||||||
$self->render(
|
$self->render(
|
||||||
message => 'Welcome to the Mojolicious real-time web framework!');
|
message => 'Looks like your TtRenderer is working!');
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
package MyApp;
|
package MyApp;
|
||||||
use Mojo::Base 'Mojolicious';
|
use Mojo::Base 'Mojolicious';
|
||||||
|
|
||||||
# This method will run once at server start
|
|
||||||
sub startup {
|
sub startup {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
$self->plugin('tt_renderer');
|
$self->plugin('tt_renderer');
|
||||||
|
|
||||||
# Router
|
|
||||||
my $r = $self->routes;
|
my $r = $self->routes;
|
||||||
|
|
||||||
# Normal route to controller
|
|
||||||
$r->get('/')->to('example#welcome');
|
$r->get('/')->to('example#welcome');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ use Mojo::Base 'Mojolicious::Controller';
|
|||||||
sub welcome {
|
sub welcome {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
# Render template "example/welcome.html.ep" with message
|
# Render template "example/welcome.html.tt" with message
|
||||||
$self->render(
|
$self->render(
|
||||||
message => 'Welcome to the Mojolicious real-time web framework!');
|
message => 'Looks like your TtRenderer is working!');
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
Reference in new issue
Block a user