Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/env perl use Mojolicious::Lite; plugin 'HTMLTemplateProRenderer'; # Render template in "templates/index.tmpl" get '/test' => sub { my $c = shift; $c->render(template => 'index'); #$c->render('index'); # fill in some parameters $c->param(HOME => $ENV{HOME}); $c->param(PATH => $ENV{PATH}); }; app->start;
<html> <head><title>Test Template</title> <body> My Home Directory is <TMPL_VAR NAME=HOME> <p> My Path is set to <TMPL_VAR NAME=PATH> </body> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mojolicious HTMLTemplateProRenderer
by beech (Parson) on Feb 15, 2017 at 01:06 UTC | |
by Maresia (Beadle) on Feb 15, 2017 at 02:09 UTC | |
by beech (Parson) on Feb 15, 2017 at 02:28 UTC | |
by Anonymous Monk on Feb 15, 2017 at 13:50 UTC | |
by beech (Parson) on Feb 16, 2017 at 01:08 UTC | |
|
Re: HTML::Template Plugin
by Anonymous Monk on Feb 14, 2017 at 21:00 UTC | |
by Anonymous Monk on Feb 14, 2017 at 21:03 UTC | |
by Anonymous Monk on Feb 14, 2017 at 21:16 UTC | |
by Anonymous Monk on Feb 14, 2017 at 22:21 UTC | |
by Anonymous Monk on Feb 14, 2017 at 22:57 UTC | |
|