Re: [Maypole] Using custom TT filters/plugins from Maypole?

From: Nic Gibson (nicg at noslogan.org)
Date: Wed Sep 01 2004 - 09:17:59 BST


On Tue, Aug 31, 2004 at 04:10:40PM -0400, Jesse Sheidlower wrote:
>
> Perhaps this is entirely a Template Toolkit question.
>
> I'd like to use custom filters and/or plugins from within
> a Maypole application. However, there's no way to specify
> these in Maypole::View::TT.
>
> Is there another way to declare these such that Maypole can
> find them? Or would it make sense to extend Maypole::View::TT
> so that the Template->new call will look for filters/plugins
> in a Maypole configuration file? Or is there some other way
> of doing this?
>
> Thanks.
>
> Jesse Sheidlower

I did this by writing a replacement for Maypole::View::TT.
I needed to pass custom configuration data and needed to
add a filter.

I can give you my code but it's really very trivial.

I'm in the process of seeing if I can write something a little
more sophisticated in that I want to see if I can write a new
version of Template::Provider that uses the
Maypole::View::Base->paths method to work out the include path
on the fly - this would allow me to keep a single Template object
in memory for the life of an Apache child process (this would
obviously be in the context of Apache::MVC). There are definite
performance benefits available there. In fact, the original
rewrite of the Maypole::View::TT object was to support a
compiled template cache.

Anyone interested if I get this working?

nic

-- 
they were brought up on strange propaganda
they have been trained to hate and destroy

_______________________________________________ maypole mailing list maypole at lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT