Apache-Template
view release on metacpan or search on metacpan
lib/Apache/Template.pm view on Meta::CPAN
TT2AnyCase On
=item TT2Interpolate
Equivalent to the INTERPOLATE configuration item, this flag can be set
to allow simple variables of the form C<$var> to be embedded within
templates, outside of regular directives. By default, this setting is
'Off' and variables must appear in the form [% var %], or more explicitly,
[% GET var %].
TT2Interpolate On
=item TT2IncludePath
Equivalent to the INCLUDE_PATH configuration item. This can be used
to specify one or more directories in which templates are located.
Multiple directories may appear on each TT2IncludePath directive line,
and the directive may be repeated. Directories are searched in the
order defined.
TT2IncludePath /usr/local/tt2/templates
TT2InludePath /home/abw/tt2 /tmp/tt2
Note that this only affects templates which are processed via
directive such as INCLUDE, PROCESS, INSERT, WRAPPER, etc. The full
path of the main template processed by the Apache/mod_perl handler is
generated (by Apache) by appending the request URI to the
DocumentRoot, as per usual. For example, consider the following
configuration extract:
DocumentRoot /usr/local/web/ttdocs
[...]
TT2IncludePath /usr/local/tt2/templates
<Files *.tt2>
SetHandler perl-script
PerlHandler Apache::Template
</Files>
A request with a URI of '/foo/bar.tt2' will cause the handler to
process the file '/usr/local/web/ttdocs/foo/bar.tt2' (i.e.
DocumentRoot + URI). If that file should include a directive such
as [% INCLUDE foo/bar.tt2 %] then that template should exist as the
file '/usr/local/tt2/templates/foo/bar.tt2' (i.e. TT2IncludePath +
template name).
=item TT2Absolute
Equivalent to the ABSOLUTE configuration item, this flag can be enabled
to allow templates to be processed (via INCLUDE, PROCESS, etc.) which are
specified with absolute filenames.
TT2Absolute On
With the flag enabled a template directive of the form:
[% INCLUDE /etc/passwd %]
will be honoured. The default setting is 'Off' and any attempt to
load a template by absolute filename will result in a 'file' exception
being throw with a message indicating that the ABSOLUTE option is not
set. See L<Template> for further discussion on exception handling.
=item TT2Relative
Equivalent to the RELATIVE configuration item. This is similar to the
TT2Absolute option, but relating to files specified with a relative filename,
that is, starting with './' or '../'
TT2Relative On
Enabling the option permits templates to be specifed as per this example:
[% INCLUDE ../../../etc/passwd %]
As with TT2Absolute, this option is set 'Off', causing a 'file' exception
to be thrown if used in this way.
=item TT2Delimiter
Equivalent to the DELIMTER configuration item, this can be set to define
an alternate delimiter for separating multiple TT2IncludePath options.
By default, it is set to ':', and thus multiple directories can be specified
as:
TT2IncludePath /here:/there
Note that Apache implicitly supports space-delimited options, so the
following is also valid and defines 3 directories, /here, /there and
/anywhere.
TT2IncludePath /here:/there /anywhere
If you're unfortunate enough to be running Apache on a Win32 system and
you need to specify a ':' in a path name, then set the TT2Delimiter to
an alternate value to avoid confusing the Template Toolkit into thinking
you're specifying more than one directory:
TT2Delimiter ,
TT2IncludePath C:/HERE D:/THERE E:/ANYWHERE
=item TT2PreProcess
Equivalent to PRE_PROCESS, this option allows one or more templates to
be named which should be processed before the main template. This can
be used to process a global configuration file, add canned headers,
etc. These templates should be located in one of the TT2IncludePath
directories, or specified absolutely if the TT2Absolute option is set.
TT2PreProcess config header
=item TT2PostProcess
Equivalent to POST_PROCESS, this option allow one or more templates to
be named which should be processed after the main template, e.g. to
add standard footers. As per TTPreProcess, these should be located in
one of the TT2IncludePath directories, or specified absolutely if the
TT2Absolute option is set.
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 %]
( run in 1.955 second using v1.01-cache-2.11-cpan-39bf76dae61 )