[Templates] Apache::Template and persistant pnotes across internal_redirects
Rick Myers
rik@sumthin.nu
Sat, 16 Mar 2002 11:59:30 -0500
I've been sort of banging my head on splitting my cgi code
from user-editable text for a couple weeks now, yet the coin
hasn't quite dropped. Maybe I'm trying too hard. :-)
The one solution I've come up with so far is to just point
the public to a directory of Apache::Registry scripts. Each
script then fills pnotes with references to this/that/other
and calls internal_redirect to a "mirror" template page.
The templates then have access to this/that/other via the
pnotes hash. Unfortunately, that doesn't work since pnotes
aren't persistant across the redirect.
Having said that, I'd like to suggest a small change to
Template::Service::Apache and ask for comments.
- $params->{ pnotes } = $request->pnotes()
+ $params->{ pnotes } = $request->prev->pnotes() || $request->pnotes()
if $all or $plist->{ pnotes };
I haven't tested this outside the environment described
above, but just looking at it suggests pnotes will fail in
classical use. Perhaps an explicit test, or maybe merging
the two pnotes tables, or even another variable such as
ppnotes?
Am I barking up the wrong tree?
--rick