DESCRIPTION

Text::Xslate is a template engine tuned for persistent applications. This engine introduces the virtual machine paradigm. That is, templates are compiled into xslate opcodes, and then executed by the xslate virtual machine.

The philosophy for Xslate is sandboxing that the template logic should not have no access outside the template beyond your permission.

This software is under development. Version 0.1xxx is a developing stage, which may include radical changes. Version 0.2xxx and more will be somewhat stable.

Features

High performance

Xslate has a virtual machine written in XS, which is highly optimized. According to benchmarks, Xslate is 2-10 times faster than other template engines (Template-Toolkit, HTML::Template::Pro, Text::MicroTemplate, etc.).

Template cascading

Xslate supports template cascading, which allows you to extend templates with block modifiers. It is like traditional template inclusion, but is more powerful.

This mechanism is also called as template inheritance.

Syntax alternation

The Xslate engine and parser/compiler are completely separated so that one can use alternative parsers.

For example, TTerse, a Template-Toolkit-like parser, is supported as a completely different syntax.

INTERFACE

Methods

Text::Xslate->new(%options) :XslateEngine

Creates a new xslate template engine.

Possible options are:

path => \@path // ['.']

Specifies the include paths.

cache => $level // 1

Sets the cache level.

If $level == 1 (default), Xslate caches compiled templates on the disk, and checks the freshness of the original templates every time.

If $level >= 2, caches will be created but the freshness will not be checked.