Before I reinvent the wheel, Call for href munging prefilters
| From: | Greg Stark | Date: | Thu, 29 Apr 2004 18:46:25 +0000 |
| Subject: | Before I reinvent the wheel, Call for href munging prefilters | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11325@lists.php.net to get a copy of this message | ||
I'm sitting here about to reimplement something I'm sure has been done many
times in the past. So I'm wondering if someone's done it in Smarty yet.
I want to track some information on every page hit. In my case I want to use
it for an uber-referrer that can identify specifically which hit in my
database logs the referring page was. I have the unique identifier handy as a
Smarty template var, I just don't want to have to manually modify every href
and every form action etc to pass it.
So what I was about to do is implement a prefilter that munges all the href=
and action= attributes to pass an extra parameter which would be the template
var.
I'm sure this has been done before. Usually the motivation is for cookie-less
sessions. The Perl ASP.pm had this when I used it three years ago. And Smarty
with this convenient prefilter thing makes it a pretty natural idea.
So before I slog through the annoying regular expression munging, surely
someone has done it already?
--
greg