> What, like subclassing Template::Provider to fetch templates from a
> 
> database?   :-)

While Template::Provider can be easily subclassed, its fetch method doesn't
know the context, and thus can't access any data from the context like
the document stack (except for using caller(), which I refuse to use
because it's not reliable when you subclass).  In order to fix this situation,
I had to pass an extra parameter into Provider::fetch, namely $self (the
context). This works, but is a bit brittle, since it sort of violates
the API specs.  Of course since my custom Provider has to make callbacks
into the Context that don't exist in Template::Context anyway, I don't
suppose I can always avoid breaking the interface contract in subclasses.
 Kind of makes me wish perl supported named args in a more efficient
manner...


__________________________________________________
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com



Reply via email to