[Templates] Global matching

Perrin Harkins perrin@elem.com
Thu, 05 Sep 2002 09:02:04 -0400


Mark Fowler wrote:
> My handler (in theory at least) shouldn't care about how the output 
> is rendered - that's the template's job.  Essentially if I find I need the 
> ability to count occurrences in the template then it's not really the 
> handlers problem - the template should worry about it and load plugins for 
> itself.

The way I think of it, I am not making any attempt to determine which 
templates need a certain functionality but rather adding a general-use 
keyword to TT itself.  I have an accessor method that is called in my 
handlers when they want to process a template, and that code always adds 
my site-wide functions as well as setting up the include path, etc. 
I've used this in the past to add things like a URI escaping function.

- Perrin