Apache-Template
view release on metacpan or search on metacpan
lib/Apache/Template.pm view on Meta::CPAN
TT2PostProcess copyright footer
=item TT2Process
This is equivalent to the PROCESS configuration item. It can be used
to specify one or more templates to be process instead of the main
template. This can be used to apply a standard "wrapper" around all
template files processed by the handler.
TT2Process mainpage
The original template (i.e. whose path is formed from the DocumentRoot
+ URI, as explained in the L<TT2IncludePath|TT2IncludePath> item
above) is preloaded and available as the 'template' variable. This a
typical TT2Process template might look like:
[% PROCESS header %]
[% PROCESS $template %]
[% PROCESS footer %]
Note the use of the leading '$' on template to defeat the auto-quoting
mechanism which is applied to INCLUDE, PROCESS, etc., directives. The
directive would otherwise by interpreted as:
[% PROCESS "template" %]
=item TT2Wrapper
This is equivalent to the WRAPPER configuration item. It can be used
to specify one or more templates to be wrapped around the content
generated by processing the main page template.
TT2Wrapper sitewrap
The original page template is processed first. The wrapper template
is then processed, with the C<content> variable containing the output
generated by processing the main page template.
Multiple wrapper templates can be specified. For example, to wrap each
page in the F<layout> template, and then to wrap that in the F<htmlpage>
template, you would write:
TT2Wrapper htmlpage layout
Or:
TT2Wrapper htmlpage
TT2Wrapper layout
Note that the TT2Wrapper options are specified in "outside-in" order
(i.e. the outer wrapper, followed by the inner wrapper). However,
they are processed in reverse "inside-out" order (i.e. the page content,
followed by the inner wrapper, followed by the outer wrapper).
=item TT2Default
This is equivalent to the DEFAULT configuration item. This can be
used to name a template to be used in place of a missing template
specified in a directive such as INCLUDE, PROCESS, INSERT, etc. Note
that if the main template is not found (i.e. that which is mapped from
the URI) then the handler will decline the request, resulting in a 404
- Not Found. The template specified should exist in one of the
directories named by TT2IncludePath.
TT2Default nonsuch
=item TT2Error
This is equivalent to the ERROR configuration item. It can be
used to name a template to be used to report errors that are otherwise
uncaught. The template specified should exist in one of the
directories named by TT2IncludePath. When the error template is
processed, the 'error' variable will be set to contain the relevant
error details.
TT2Error error
=item TT2Variable
This option allows you to define values for simple template variables.
If you have lots of variables to define then you'll probably want to
put them in a config template and pre-process it with TT2PreProcess.
TT2Variable version 3.14
=item TT2Constant
This option allows you to define values for constants. These are
similar to regular TT variables, but are resolved once when the
template is compiled.
TT2Constant pi 3.14
=item TT2ConstantsNamespace
Constants are accessible via the 'constants' namespace by default (e.g.
[% constants.pi %]. This option can be used to provide an alternate
namespace for constants.
TT2ConstantNamespace my
=item TT2EvalPerl
This is equivalent to the EVAL_PERL configuration item. It can be
enabled to allow embedded [% PERL %] ... [% END %] sections
within templates. It is disabled by default and any PERL sections
encountered will raise 'perl' exceptions with the message 'EVAL_PERL
not set'.
TT2EvalPerl On
=item TT2LoadPerl
This is equivalent to the LOAD_PERL configuration item which allows
regular Perl modules to be loaded as Template Toolkit plugins via the
USE directive. It is set 'Off' by default.
TT2LoadPerl On
=item TT2Recursion
( run in 1.475 second using v1.01-cache-2.11-cpan-99c4e6809bf )