[Templates] Apache::Request from Apache::Template

darren chamberlain dlc@users.sourceforge.net
Fri, 8 Mar 2002 16:08:26 -0500


Quoting Allen Day <allenday@1-up.net> [Mar 08, 2002 15:53]:
> Thanks for the plugin example.  Why though is this a better way
> to do it?  I liked Andy Wardley's suggestion to have an option
> in the httpd.conf file as:
> 
>   TT2Params uri request
> 
> I can't think of a situation where someone would want to access
> an Apache::Request object in TT2 when they weren't using
> Apache::Template, so this makes more sense.
> 
> I do agree that 'request' should not be enabled by default, but
> it should be available as a directive option.

Enough talk already! ;) Here's a patch against Apache::Template
0.06:

--- lib/Template/Service/Apache.pm.orig Fri Mar  8 16:05:28 2002
+++ lib/Template/Service/Apache.pm      Fri Mar  8 16:06:23 2002
@@ -126,6 +126,9 @@
     $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;


(darren)

-- 
OCCAM'S ERASER:
The philosophical principle that even the simplest solution is bound
to have something wrong with it.