NAME
Template::TAL::Template - a TAL template
SYNOPSIS
my $template = Template::TAL::Template->new->source( "<html>...</html>" );
my $dom = $template->process( {} );
print $dom->toString();
DESCRIPTION
This class represents a single TAL template, and stores its XML source. You'll probably not see these objects directly - Template::TAL takes template names and returns bytes. But you might.
METHODS
- new()
-
Create a new TAL template object.
- source( [ set source ] )
-
the TAL source of this template, as a scalar
- languages
-
a listref of language plugins this template will use when parsing. All templates get at least the Template::TAL::Language:TAL language module.
- add_language( language module, module, module... )
-
adds a language to the list of those used by the template renderer. 'module' here can be a classname or an instance.
- process( data hash )
-
processes the template object, returns an XML::LibXML::Document object. The data hash passed in forms the global context of the tempalte. The template code will be able to change this hash using the tal:define directive in 'global' mode (see Template::TAL::Language::TAL).
- process_node( node, local context, global context)
-
this processes a given DOM node with the passed contexts, using the Template instance's language plugins, and manipulates the DOM node according to the instructions of the plugins. Returns nothing interesting - it is expected to change the DOM tree in place.
COPYRIGHT
Written by Tom Insam, Copyright 2005 Fotango Ltd. All Rights Reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.