Dancer2::Template::HTCompiled - HTML::Template::Compiled template engine for Dancer2
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 }; };
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);
HTML::Template::Compiled, Dancer2
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.
To install Dancer2::Template::HTCompiled, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Template::HTCompiled
CPAN shell
perl -MCPAN -e shell install Dancer2::Template::HTCompiled
For more information on module installation, please visit the detailed CPAN module installation guide.