Apache-Template

 view release on metacpan or  search on metacpan

lib/Apache/Template.pm  view on Meta::CPAN

add the 'type' value to have Apache::Template send the Content-Type
header.

    TT2Headers      type length

If you don't specify 'type' in the TT2Headers option then
Apache::Template will not add a Content-Type header.  

The default value for Content-Type is 'text/html' but can now be changed
using the TT2ContentType option.

    TT2ContentType  text/xml

=head1 CONFIGURATION

Most of the Apache::Template configuration directives relate directly
to their Template Toolkit counterparts, differing only in having a
'TT2' prefix, mixed capitalisation and lack of underscores to space
individual words.  This is to keep Apache::Template configuration
directives in keeping with the preferred Apache/mod_perl style.

e.g.

    Apache::Template  =>  Template Toolkit
    --------------------------------------
    TT2Trim               TRIM
    TT2IncludePath        INCLUDE_PATH
    TT2PostProcess        POST_PROCESS
    ...etc...

In some cases, the configuration directives are named or behave
slightly differently to optimise for the Apache/mod_perl environment
or domain specific features.  For example, the TT2Tags configuration
directive can be used to set TAG_STYLE and/or START_TAG and END_TAG
and as such, is more akin to the Template Toolkit TAGS directive.

e.g.

    TT2Tags     html
    TT2Tags     <!--  -->

The configuration directives are listed in full below.  Consult 
L<Template> for further information on their effects within the 
Template Toolkit.

=over 4

=item TT2Tags

Used to set the tags used to indicate Template Toolkit directives
within source templates.  A single value can be specified to 
indicate a TAG_STYLE, e.g.

    TT2Tags     html

A pair of values can be used to indicate a START_TAG and END_TAG.

    TT2Tags     <!--    -->

Note that, unlike the Template Toolkit START_TAG and END_TAG
configuration options, these values are automatically escaped to
remove any special meaning within regular expressions.

    TT2Tags     [*  *]  # no need to escape [ or *

By default, the start and end tags are set to C<[%> and C<%]>
respectively.  Thus, directives are embedded in the form: 
[% INCLUDE my/file %].

=item TT2PreChomp

Equivalent to the PRE_CHOMP configuration item.  This flag can be set
to have removed any whitespace preceeding a directive, up to and
including the preceeding newline.  Default is 'Off'.

    TT2PreChomp     On

=item TT2PostChomp

Equivalent to the POST_CHOMP configuration item.  This flag can be set
to have any whitespace after a directive automatically removed, up to 
and including the following newline.  Default is 'Off'.

    TT2PostChomp    On

=item TT2Trim

Equivalent to the TRIM configuration item, this flag can be set
to have all surrounding whitespace stripped from template output.
Default is 'Off'.

    TT2Trim         On

=item TT2AnyCase

Equivalent to the ANY_CASE configuration item, this flag can be set
to allow directive keywords to be specified in any case.  By default,
this setting is 'Off' and all directive (e.g. 'INCLUDE', 'FOREACH', 
etc.) should be specified in UPPER CASE only.

    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



( run in 0.894 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )