Text::Xslate is a template engine, tuned for persistent applications, safe as an HTML generator, and with rich features.
There are a lot of template engines in CPAN, for example Template-Toolkit, Text::MicroTemplate, HTML::Template, and so on, but all of them have demerits at some points. This is why Xslate is developed and now it is well-honed as the standard template engine for web applications.
The concept of Xslate is strongly influenced by Text::MicroTemplate and Template-Toolkit 2, but the central philosophy of Xslate is different from them. That is, the philosophy is sandboxing that the template logic should not have no access outside the template beyond your permission.
SYNOPSIS
use Text::Xslate qw(mark_raw);
my $tx = Text::Xslate->new();
my %vars = (
title => 'A list of books',
books => [
{ title => 'Islands in the stream' },
{ title => 'Programming Perl' },
# ...
],
# mark HTML components as raw not to escape its HTML tags
gadget => mark_raw('< div class="gadget" >...< /div >'),
);
# for files
print $tx->render('hello.tx', \%vars);
# for strings
my $template = q{
< h1 >< : $title : >< /h1 >
: for $books -> $book {
< li >< : $book.title : >< /li >
: } # for
< /ul >
};
print $tx->render_string($template, \%vars);
Product's homepage
Requirements:
· Perl