Dancer2::Template::Xslate - Text::Xslate template engine for Dancer2
config.yaml:
config.yaml
template: Xslate
A Dancer 2 application:
use Dancer2; get '/page/:number' => sub { my $page_num = params->{number}; template "foo.tx", { page_num => $page_num }; };
If you want to use cascading templates to manage page layouts make sure you disable Dancer2 layouts.
In config.yaml, comment the layout keyword:
layout
# The default layout to use for your application (located in # views/layouts/main.tt) # layout: "main"
If you don't, Dancer2 will render your template and then render the layout template. If your layout template doesn't have the content placeholder only the layout HTML will be returned.
content
Renders a template. $template can be one of:
$template
a string of the path to a template file (*.tx, not *.tt like the core Dancer2 template engines)
a reference to a string containing prerendered template content
Xslate rendering engine for Dancer 1.
Richard Simões <rsimoes AT cpan DOT org>
<rsimoes AT cpan DOT org>
Copyright © 2013 Richard Simões. This module is released under the terms of the MIT License and may be modified and/or redistributed under the same or any compatible license.
To install Dancer2::Template::Xslate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2::Template::Xslate
CPAN shell
perl -MCPAN -e shell install Dancer2::Template::Xslate
For more information on module installation, please visit the detailed CPAN module installation guide.