Paul Seamons > Template-Alloy-1.016 > Template::Alloy::TT

Download:
Template-Alloy-1.016.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
View/Report Bugs
Source   Latest Release: Template-Alloy-1.020

NAME ^

Template::Alloy::TT - Template::Toolkit role

DESCRIPTION ^

The Template::Alloy::TT role provides the syntax and the interface for Template::Toolkit version 1, 2, and 3. It also brings many of the features from the various templating systems.

And it is fast.

See the Template::Alloy documentation for configuration and other parameters.

HOW IS Template::Alloy DIFFERENT FROM Template::Toolkit ^

Alloy uses the same base template syntax and configuration items as TT2, but the internals of Alloy were written from scratch. Additionally much of the planned TT3 syntax is supported as well as most of that of HTML::Template::Expr. The following is a list of some of the ways that the configuration and syntax of Alloy are different from that of TT2. Note: items that are planned to work in TT3 are marked with (TT3).

UNSUPPORTED TT2 CONFIGURATION ^

LOAD_TEMPLATES

Template::Alloy has its own mechanism for loading and storing compiled templates. TT would use a Template::Provider that would return a Template::Document. The closest thing in Template::Alloy is the load_template method. There is no immediate plan to support the TT behavior.

LOAD_PLUGINS

Template::Alloy uses its own mechanism for loading plugins. TT would use a Template::Plugins object to load plugins requested via the USE directive. The functionality for doing this in Template::Alloy is contained in the list_plugins method and the play_USE method. There is no immediate plan to support the TT behavior.

Full support is offered for the PLUGINS and LOAD_PERL configuration items.

Also note that Template::Alloy only natively supports the Iterator plugin. Any of the other plugins requested will need to provided by installing Template::Toolkit or the appropriate plugin module.

LOAD_FILTERS

Template::Alloy uses its own mechanism for loading filters. TT would use the Template::Filters object to load filters requested via the FILTER directive. The functionality for doing this in Template::Alloy is contained in the list_filters method and the play_expr method.

Full support is offered for the FILTERS configuration item.

TOLERANT

This option is used by the LOAD_TEMPLATES and LOAD_PLUGINS options and is not applicable in Template::Alloy.

SERVICE

Template::Alloy has no concept of service (theoretically the Template::Alloy is the "service").

CONTEXT

Template::Alloy provides its own pseudo context object to plugins, filters, and perl blocks. The Template::Alloy model doesn't really allow for a separate context. Template::Alloy IS the context.

PARSER

Template::Alloy has its own built in parser. The closest similarity is the parse_tree method. The output of parse_tree is an optree that is later run by execute_tree. Alloy provides a backend to the Template::Parser::Alloy module which can be used to replace the default parser when using the standard Template::Toolkit library.

GRAMMAR

Template::Alloy maintains its own grammar. The grammar is defined in the parse_tree method and the callbacks listed in the global $Template::Alloy::Parse::DIRECTIVES hashref.

AUTHOR ^

Paul Seamons <perl at seamons dot com>

LICENSE ^

This module may be distributed under the same terms as Perl itself.

syntax highlighting: