|
NAMEText::MicroMason::HTMLTemplate - Alternate Syntax like HTML::TemplateSYNOPSISInstead of using this class directly, pass its name to be mixed in:use Text::MicroMason; my $mason = Text::MicroMason::Base->new( -HTMLTemplate ); Use the standard compile and execute methods to parse and evaluate templates: print $mason->compile( text=>$template )->( @%args ); print $mason->execute( text=>$template, @args ); Or use HTML::Template's calling conventions: $template = Text::MicroMason->new( -HTMLTemplate, filename=>'simple.tmpl' ); $template->param( %arguments ); print $template->output(); HTML::Template provides a syntax to embed values into a text template: <TMPL_IF NAME="user_is_dave"> I'm sorry <TMPLVAR NAME="name">, I'm afraid I can't do that right now. <TMPL_ELSE> <TMPL_IF NAME="daytime_is_morning"> Good morning, <TMPLVAR NAME="name">! <TMPL_ELSE> Good afternoon, <TMPLVAR NAME="name">! </TMPL_IF> </TMPL_IF> DESCRIPTIONThis mixin class overrides several methods to allow MicroMason to emulate the template syntax and some of the other features of HTML::Template.This class automatically includes the following other mixins: TemplateDir, HasParams, and StoreOne. Compatibility with HTML::TemplateThis is not a drop-in replacement for HTML::Template, as the implementation is quite different, but it should be able to process most existing templates without major changes.This should allow current HTML::Template users to take advantage of MicroMason's one-time compilation feature, which in theory could be faster than HTML::Template's run-time interpretation. (No benchmarking yet.) The following features of HTML::Template are not supported yet:
The following features of HTML::Template will likely never be supported due to fundamental differences in implementation:
Contributed patches to more closely support the behavior of HTML::Template would be welcomed by the author. Template SyntaxThe following elements are recognized by the HTMLTemplate lexer:
The following tags are supported by the HTMLTemplate assembler:
Supported Attributes
Public Methods
Private Methods
SEE ALSOThe interface being emulated is described in HTML::Template.For an overview of this templating framework, see Text::MicroMason. This is a mixin class intended for use with Text::MicroMason::Base. For distribution, installation, support, copyright and license information, see Text::MicroMason::Docs::ReadMe.
Visit the GSP FreeBSD Man Page Interface. |