What is Xslate?
Xslate is a template engine for Perl5 with the following features:
- Extremely fast - Up to 50~100 times faster than TT2! (see the benchmarks for more info)
- Supports multiple template syntaxes - TT2 compatible syntax, for example
- Easy to enhance - by importing subroutines and/or by calling object methods
- Safe - Escapes HTML meta characters by default
Documentation
Getting started
Install cpanminus and then run the following command to install Xslate.
$ cpanm Text::Xslate
Introduction to Xslate
Template code
: # in Kolon, the default syntax
: for ["Xslate"] -> $lang {
Hello, <: $lang :> world!
: }
[%# in TTerse, a TT2 compatible syntax -%]
[% FOR lang IN ["Xslate"] -%]
Hello, [% lang %] world!
[% END -%]
{* in Clevy, a Smarty compatible syntax *}
{foreach from=`["Xslate"]` item=lang}
Hello, {$lang} world!
{/foreach}
What People Say
- xslate++ # pretty fast - tokuhirom
- Introducing Text::Xslate - lestrrat
Repositories
- github:Text-Xslate - Xslate template engine
- github:Text-Xslate-Bridge-TT2Like - Use TT2 methods and filters (standalone)
- github:Text-Xslate-Bridge-TT2 - Use TT2 methods and filters (uses TT2)
- github:Text-Xslate-Bridge-Alloy - Use Template::Alloy methods and filters
- github:Text-Clevy - Smarty compatible syntax and functions
