NAME
Dancer::Template::Tiny - Template::Tiny engine for Dancer
VERSION
version 2.0000_01
SYNOPSIS
This template engine allows you to use Template::Tiny in Dancer.
Template::Tiny is an implementation of a subset of Template::Toolkit (the major parts) which takes much less memory and is faster. If you're only using the main functions of Template::Toolkit, you could use Template::Tiny. You can also seemlessly move back to Template::Toolkit whenever you want.
However, Dancer uses a modified version of Template::Tiny, which is Dancer::Template::Implementation::ForkedTiny. It adds 2 features :
opening and closing tag are now configurable
CodeRefs are evaluated and their results is inserted in the result.
You can read more on Dancer::Template::Implementation::ForkedTiny.
To use this engine, all you need to configure in your Dancer's config.yaml
:
template: "tiny"
Of course, you can also set this while working using set
:
# code code code
set template => 'tiny';
Since Dancer has internal support for a wrapper-like option with the layout
configuration option, you can have a Template::Toolkit-like WRAPPER even though Template::Tiny doesn't really support it. :)
METHODS
render
Renders the template. Accepts a string to a file or a reference to a string of the template.
AUTHOR
Dancer Core Developers
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 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.