NAME
Dancer2::Template::HTCompiled - HTML::Template::Compiled template engine for Dancer2
SYNOPSIS
config.yaml:
template: HTCompiled
engines:
template:
HTCompiled:
path: "views"
case_sensitive: 1
default_escape: "HTML"
loop_context_vars: 1
tagstyle: ["-classic", "-comment", "-asp", "+tt"]
expire_time: 1
use Dancer2;
get /page/:number => sub {
my $page_num = params->{number};
template "foo.html", { page_num => $page_num };
};
METHODS
- render
-
my $output = $htc->render($template, $param); my $output = $htc->render(\$string, $param); my $htc = Dancer2::Template::HTCompiled->new( config => { path => "path/to/templates", }, ); my $param = { something => 23, }; my $template = "foo.html"; my $output = $htc->render($template, $param); my $string = "foo [%= bar %]"; my $output = $htc->render(\$string, $param);
SEE ALSO
HTML::Template::Compiled, Dancer2
LICENSE
This software is copyright (c) 2014 by Tina Müller.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.