Dancer2::Template::TemplateToolkit - Template toolkit engine for Dancer2
version 0.200003
To use this engine, you may configure Dancer2 via config.yaml:
config.yaml
template: "template_toolkit"
Or you may also change the rendering engine on a per-route basis by setting it manually with set:
set
# code code code set template => 'template_toolkit';
Most configuration variables available when creating a new instance of a Template::Toolkit object can be declared inside the template toolkit section on the engines configuration (see your config.yml file):
engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
In addition to the standard configuration variables, the option show_private_variables is also available. Template::Toolkit, by default, do not render private variables (the ones starting with an underscore). If in your project it gets easier to disable this feature than changing variable names, add this option to your configuration.
show_private_variables
show_private_variables: true
Warning: Given the way Template::Toolkit implements this option, different Dancer2 applications running within the same interpreter will share this option!
This template engine allows you to use Template::Toolkit in Dancer2.
Renders the template. The first arg is a filename for the template file or a reference to a string that contains the template. The second arg is a hashref for the tokens that you wish to pass to Template::Toolkit for rendering.
Dancer2, Dancer2::Core::Role::Template, Template::Toolkit.
Dancer Core Developers
This software is copyright (c) 2016 by Alexis Sukrieh.
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, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2
CPAN shell
perl -MCPAN -e shell install Dancer2
For more information on module installation, please visit the detailed CPAN module installation guide.