Apache-Template

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

* Change handler() method to create a new service for each unique 
  hostname.  This now handles virtual hosts correctly.

* Added TT2Tolerant, TT2Constant and TT2ConstantsNamespace options.


#------------------------------------------------------------------------
# Version 0.06 - 22nd January 2002
#------------------------------------------------------------------------

* Bumped version number so that PAUSE will allow me to upload it.
  The first attempt to upload 0.05 failed but left a CPAN database 
  entry, preventing me from uploading 0.05 again.


#------------------------------------------------------------------------
# Version 0.05 - 22nd January 2002
#------------------------------------------------------------------------

* Backed out Darren's first patch listed below in 0.04 because it changes
  the nature of, and interface to the various parameters (e.g. env('foo') 
  vs env.foo).  I tried to enclose these items in object wrappers so that
  they can look like hashes but propagate changes back up to the Apache
  request object, but it wasn't easy.  So I've gone with the original 
  behaviour for now until someting better comes along.

* Fixed an "uninitialised value in numeric eq (==)" warning in the 
  Template::Server::Apache module.  Thanks to Pierre Phaneuf for 
  reporting the problem.

* Applied a patch from Darren Chamberlain which adds the 'uploads' option
  to TT2Params for handling file uploads.

* Applied a patch from Rick Myers to prevent the Apache::Template::_merge
  method from merging the same configuration hash together.


#------------------------------------------------------------------------
# Version 0.04 - 15th June 2001
#------------------------------------------------------------------------

* Applied 2 patches from Darren Chamberlain:

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

# TT2Headers length etag        # add certain HTTP headers
#------------------------------------------------------------------------

sub TT2Headers($$@) {
    my ($cfg, $parms, $item) = @_;
    my $headers = $cfg->{ SERVICE_HEADERS } ||= [ ];
    push(@$headers, $item);
}

#------------------------------------------------------------------------
# TT2Params uri env pnotes uploads request            # add template vars
#------------------------------------------------------------------------

sub TT2Params($$@) {
    my ($cfg, $parms, $item) = @_;
    my $params = $cfg->{ SERVICE_PARAMS } ||= [ ];
    push(@$params, $item);
}

#------------------------------------------------------------------------
# TT2ContentType   text/xml                         # custom content type

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

This option can be used to set a Content-Type other than the default
value of 'text/html'.

    TT2ContentType   text/xml

=item TT2Params

Allows you to specify which parameters you want defined as template
variables.  Current permitted values are 'uri', 'env' (hash of
environment variables), 'params' (hash of CGI parameters), 'pnotes'
(the request pnotes hash), 'cookies' (hash of cookies), 'uploads' (a
list of Apache::Upload instances), 'request' (the Apache::Request
object) or 'all' (all of the above).

    TT2Params       uri env params uploads request

When set, these values can then be accessed from within any 
template processed:

    The URI is [% uri %]

    Server name is [% env.SERVER_NAME %]

    CGI params are:
    <table>

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


    $params->{ pnotes } = $request->pnotes()
        if $all or $plist->{ pnotes };

    $params->{ params } = { %{ $request->parms() } }
        if $all or $plist->{ params };

    $params->{ request } = $request
        if $all or $plist->{ request };

    if ($all or $plist->{ uploads }) {
        my @uploads = $request->upload;
        $params->{ uploads } = \@uploads;
    }

    $params->{ cookies } = { 
        map { $1 => escape_uri($2) if (/([^=]+)=(.*)/) }
        grep(!/^$/, split(/;\s*/, $request->header_in('cookie'))),
    } if $all or $plist->{ cookies };
    
    # add any error raised by main template failure
    $params->{ error } = $self->{ TEMPLATE_ERROR };



( run in 1.613 second using v1.01-cache-2.11-cpan-b16cb0d3907 )