]>
Dogcows Code - chaz/p5-CGI-Ex/blob - lib/CGI/Ex/Template.pm
1 package CGI
::Ex
::Template
;
5 CGI::Ex::Template - Template::Alloy based TT2/TT3/HT/HTE/Tmpl/Velocity engine.
11 use Template
::Alloy
1.004;
12 use base
qw(Template::Alloy);
30 ### install true symbol table aliases that can be localized
31 *QR_PRIVATE
= *Template
::Alloy
::QR_PRIVATE
;
32 *WHILE_MAX
= *Template
::Alloy
::WHILE_MAX
;
33 *MAX_EVAL_RECURSE
= *Template
::Alloy
::MAX_EVAL_RECURSE
;
34 *MAX_MACRO_RECURSE
= *Template
::Alloy
::MAX_MACRO_RECURSE
;
35 *STAT_TTL
= *Template
::Alloy
::STAT_TTL
;
36 *EXTRA_COMPILE_EXT
= *Template
::Alloy
::EXTRA_COMPILE_EXT
;
37 *PERL_COMPILE_EXT
= *Template
::Alloy
::PERL_COMPILE_EXT
;
38 *SCALAR_OPS
= *Template
::Alloy
::SCALAR_OPS
;
39 *FILTER_OPS
= *Template
::Alloy
::FILTER_OPS
;
40 *LIST_OPS
= *Template
::Alloy
::LIST_OPS
;
41 *HASH_OPS
= *Template
::Alloy
::HASH_OPS
;
42 *VOBJS
= *Template
::Alloy
::VOBJS
;
50 =head2 Template::Toolkit style usage
52 my $t = Template::Alloy->new(
53 INCLUDE_PATH => ['/path/to/templates'],
64 $t->process('my/template.tt', $swap)
67 # process into a variable
69 $t->process('my/template.tt', $swap, \$out);
71 ### Alloy uses the same syntax and configuration as Template::Toolkit
74 =head2 HTML::Template::Expr style usage
76 my $t = Template::Alloy->new(
77 filename => 'my/template.ht',
78 path => ['/path/to/templates'],
90 # print to STDOUT (errors die)
91 $t->output(print_to => \*STDOUT);
93 # process into a variable
96 ### Alloy can also use the same syntax and configuration as HTML::Template
98 =head2 Text::Tmpl style usage
100 my $t = Template::Alloy->new;
109 $t->set_delimiters('#[', ']#');
111 $t->set_values($swap);
112 $t->set_dir('/path/to/templates');
114 my $out = $t->parse_file('my/template.tmpl');
116 my $str = "Foo #[echo $key1]# Bar";
117 my $out = $t->parse_string($str);
120 ### Alloy uses the same syntax and configuration as Text::Tmpl
122 =head2 Velocity (VTL) style usage
124 my $t = Template::Alloy->new;
133 my $out = $t->merge('my/template.vtl', $swap);
135 my $str = "#set($foo 1 + 3) ($foo) ($bar) ($!baz)";
136 my $out = $t->merge(\$str, $swap);
140 CGI::Ex::Template is the original base for the code that is now
141 Template::Alloy. Template::Alloy employed enough complexity and
142 featureset to warrant moving it out to a separate namespace.
144 CGI::Ex::Template is now a place holder subclass of Template::Alloy.
145 You can use CGI::Ex::Template as a standalone module - but it is
146 suggested that you use Template::Alloy directly instead.
148 For examples of usage, configuration, syntax, bugs, vmethods,
149 directives, etc please refer to the L<Template::Alloy> documentation.
153 This module may be distributed under the same terms as Perl itself.
157 Paul Seamons <perl at seamons dot com>
This page took 0.040122 seconds and 4 git commands to generate.