.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Template::Alloy::Tmpl 3pm" .TH Template::Alloy::Tmpl 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Template::Alloy::Tmpl \- Text::Tmpl role .SH DESCRIPTION .IX Header "DESCRIPTION" The Template::Alloy::Tmpl role provides the syntax and the interface for Text::Tmpl. It also brings many of the features from the various templating systems. .PP See the Template::Alloy documentation for configuration and other parameters. .SH ROLE_METHODS .IX Header "ROLE_METHODS" .ie n .IP """parse_tree_tmpl""" 4 .el .IP \f(CWparse_tree_tmpl\fR 4 .IX Item "parse_tree_tmpl" Called by parse_tree when syntax is set to tmpl. Parses for tags Text::Tmpl style. .ie n .IP """set_delimiters""" 4 .el .IP \f(CWset_delimiters\fR 4 .IX Item "set_delimiters" Sets the START_TAG and END_TAG to use for parsing. .Sp .Vb 1 \& $obj\->set_delimiters(\*(Aq#[\*(Aq, \*(Aq]#\*(Aq); .Ve .ie n .IP """strerror""" 4 .el .IP \f(CWstrerror\fR 4 .IX Item "strerror" Can be used for checking the error when compile fails (or you can use \->error). May be called as function or method (Text::Tmpl only allows as function). .ie n .IP """set_strip""" 4 .el .IP \f(CWset_strip\fR 4 .IX Item "set_strip" Determines if trailing whitespace on same line is removed. Default is false. .ie n .IP """set_dir""" 4 .el .IP \f(CWset_dir\fR 4 .IX Item "set_dir" Sets the path to look for included templates in. .ie n .IP """set_value""" 4 .el .IP \f(CWset_value\fR 4 .IX Item "set_value" Sets a single value that will be used during processing of the template. .Sp .Vb 1 \& $obj\->set_value(key => $value); .Ve .ie n .IP """set_values""" 4 .el .IP \f(CWset_values\fR 4 .IX Item "set_values" Sets multiple values for use during processing. .Sp .Vb 1 \& $obj\->set_values(\e%values); .Ve .ie n .IP """parse_string""" 4 .el .IP \f(CWparse_string\fR 4 .IX Item "parse_string" Processes the passed string. .Sp .Vb 1 \& my $out = $obj\->process_string("#[echo $foo]#"); .Ve .ie n .IP """parse_file""" 4 .el .IP \f(CWparse_file\fR 4 .IX Item "parse_file" Processes the passed filename. .Sp .Vb 1 \& my $out = $obj\->process_file("my/file.tmpl"); .Ve .ie n .IP """loop_iteration""" 4 .el .IP \f(CWloop_iteration\fR 4 .IX Item "loop_iteration" Same as the Text::Tmpl method \- used for adding iterations to a loop. .Sp .Vb 2 \& my $ref = $obj\->loop_iteration(\*(Aqloop1\*(Aq); # creates iteration 0 \& $ref\->set_values($hash); .Ve .ie n .IP """fetch_loop_iteration""" 4 .el .IP \f(CWfetch_loop_iteration\fR 4 .IX Item "fetch_loop_iteration" Gets a previously created loop iteration. .Sp .Vb 2 \& my $ref = $obj\->fetch_loop_iteration(\*(Aqloop1\*(Aq, 0); \& $ref\->set_values($hash); .Ve .SH "UNSUPPORTED Text::Tmpl METHODS" .IX Header "UNSUPPORTED Text::Tmpl METHODS" register_simple, register_pair, alias_simple, alias_pair, remove_simple, remove_pair, set_debug, errno .SH AUTHOR .IX Header "AUTHOR" Paul Seamons .SH LICENSE .IX Header "LICENSE" This module may be distributed under the same terms as Perl itself.