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

Allen Day allenday@ucla.edu
Fri, 8 Mar 2002 01:04:34 -0800 (PST)


Hi all.  I just joined the list.  -Allen

> I just started using Apache::Template.  Is there a way to access the
> Apache request object from inside a template?  It sure would be useful.

No there isn't.  Yes it would.  I must admit it's so obvious I'm puzzled as to
why I didn't put it in from the start.

> In Apache::Template::handler() we can add:
>
> $params->{r} = $r;

I think a better approach would be to a 'request' option to TT2Params
which would do the right thing in Template::Service::Apache::params().
Make it optional for those who want it without getting in the way of those
who don't.

BTW, check out the templates mailing list if you haven't already found it
(see tt2.org).  I don't use Apache::Template a great deal but there are at
least a couple of others on the list who are actively using and
contributing to it. It's good to run ideas past them because they've got
more experience of using it in the field.