1Template::Alloy::Tmpl(3U)ser Contributed Perl DocumentatiToenmplate::Alloy::Tmpl(3)
2
3
4

NAME

6       Template::Alloy::Tmpl - Text::Tmpl role
7

DESCRIPTION

9       The Template::Alloy::Tmpl role provides the syntax and the interface
10       for Text::Tmpl.  It also brings many of the features from the various
11       templating systems.
12
13       See the Template::Alloy documentation for configuration and other
14       parameters.
15

ROLE_METHODS

17       "parse_tree_tmpl"
18           Called by parse_tree when syntax is set to tmpl.  Parses for tags
19           Text::Tmpl style.
20
21       "set_delimiters"
22           Sets the START_TAG and END_TAG to use for parsing.
23
24               $obj->set_delimiters('#[', ']#');
25
26       "strerror"
27           Can be used for checking the error when compile fails (or you can
28           use ->error).  May be called as function or method (Text::Tmpl only
29           allows as function).
30
31       "set_strip"
32           Determines if trailing whitespace on same line is removed.  Default
33           is false.
34
35       "set_dir"
36           Sets the path to look for included templates in.
37
38       "set_value"
39           Sets a single value that will be used during processing of the
40           template.
41
42               $obj->set_value(key => $value);
43
44       "set_values"
45           Sets multiple values for use during processing.
46
47               $obj->set_values(\%values);
48
49       "parse_string"
50           Processes the passed string.
51
52               my $out = $obj->process_string("#[echo $foo]#");
53
54       "parse_file"
55           Processes the passed filename.
56
57               my $out = $obj->process_file("my/file.tmpl");
58
59       "loop_iteration"
60           Same as the Text::Tmpl method - used for adding iterations to a
61           loop.
62
63               my $ref = $obj->loop_iteration('loop1'); # creates iteration 0
64               $ref->set_values($hash);
65
66       "fetch_loop_iteration"
67           Gets a previously created loop iteration.
68
69               my $ref = $obj->fetch_loop_iteration('loop1', 0);
70               $ref->set_values($hash);
71

UNSUPPORTED Text::Tmpl METHODS

73       register_simple, register_pair, alias_simple, alias_pair,
74       remove_simple, remove_pair, set_debug, errno
75

AUTHOR

77       Paul Seamons <paul@seamons.com>
78

LICENSE

80       This module may be distributed under the same terms as Perl itself.
81
82
83
84perl v5.36.0                      2022-07-22          Template::Alloy::Tmpl(3)
Impressum