in reply to Re^2: Mojolicious HTMLTemplateProRenderer
in thread HTML::Template Plugin
Hi,
Did you use https://metacpan.org/pod/Mojolicious::Renderer#paths to tell mojo about this directory?
update: foo.pl
#!/usr/bin/env perl use Mojolicious::Lite; plugin 'HTMLTemplateProRenderer'; get '/' => sub { my $c = shift; return $c->render( 'hi', t1 => 'the first t1', ); }; my $paths = app->renderer->paths; unshift @$paths, 'exists'; app->start; __DATA__ @@ hi.html.tmpl <p> from __DATA__ its @@ hi.html.tmpl <p> <TMPL_VAR NAME="t1">
$ perl foo.pl get / [Tue Feb 14 19:24:14 2017] [debug] GET "/" [Tue Feb 14 19:24:14 2017] [debug] Routing to a callback [Tue Feb 14 19:24:14 2017] [debug] 200 OK (0.00174s, 574.713/s) <p> from __DATA__ its @@ hi.html.tmpl <p> the first t1 $ mv not_templates templates $ perl foo.pl get / [Tue Feb 14 19:24:27 2017] [debug] GET "/" [Tue Feb 14 19:24:27 2017] [debug] Routing to a callback [Tue Feb 14 19:24:27 2017] [debug] 200 OK (0.001793s, 557.724/s) <p> from templates its hi.html.tmpl <p>the first t1 $ mv not_exists exists $ perl foo.pl get / [Tue Feb 14 19:24:53 2017] [debug] GET "/" [Tue Feb 14 19:24:53 2017] [debug] Routing to a callback [Tue Feb 14 19:24:53 2017] [debug] 200 OK (0.001772s, 564.334/s) <p> from exists its hi.html.tmpl <p> the first t1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Mojolicious HTMLTemplateProRenderer
by Anonymous Monk on Feb 15, 2017 at 13:50 UTC | |
by beech (Parson) on Feb 16, 2017 at 01:08 UTC |