[Templates-cvs] cvs commit: Template2/docsrc/src/Modules/Template Parser.tt2
cvs@template-toolkit.org
cvs@template-toolkit.org
cvs 06/01/30 17:58:23
Modified: docsrc/src/Modules/Template Parser.tt2
Log:
* fixed docs to correctly describe the return value from parse()
Revision Changes Path
1.3 +11 -4 Template2/docsrc/src/Modules/Template/Parser.tt2
Index: Parser.tt2
===================================================================
RCS file: /template-toolkit/Template2/docsrc/src/Modules/Template/Parser.tt2,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Parser.tt2 2002/08/08 12:22:01 1.2
+++ Parser.tt2 2006/01/30 17:58:23 1.3
@@ -45,14 +45,21 @@
=head2 parse($text)
The parse() method parses the text passed in the first parameter and
-returns a reference to a Template::Document object which contains the
-compiled representation of the template text. On error, undef is
+returns a reference to a hash array of data defining the compiled
+representation of the template text, suitable for passing to the
+Template::Document new() constructor method. On error, undef is
returned.
Example:
- $doc = $parser->parse($text)
- || die $parser->error();
+ $data = $parser->parse($text)
+ || die $parser->error();
+
+The $data hash reference returned contains a BLOCK item containing the
+compiled Perl code for the template, a DEFBLOCKS item containing a
+reference to a hash array of sub-template BLOCKs defined within in the
+template, and a METADATA item containing a reference to a hash array
+of metadata values defined in META tags.
[* PROCESS misc/author *]