[Templates] auto filtering

Jonas Liljegren jonas@liljegren.org
12 Nov 2002 16:38:24 +0100


Andy Wardley <abw@andywardley.com> writes:

> Jonas Liljegren wrote:
> > No. That would destroyt all the markup.
> > 
> > It should only filter all the GET things.
> 
> I'll think about it some more.  Other suggestions welcome.

A default filtering could be specified in the beginning:

    my $template = Template->new({
	FILTER_GET => \&html,
    }); 

Or giving a string of anoy oif the default filters or filter objects.




A good way to optimze the stash is to have a small basic stash and a
couple of extensions that inherits from one of a few basic stashes.
The choice of stash class will be done explicitly by STASH or
implicitly by the chosen configuration options.

With FILTER_GET you would get a Template::Stash::Custom inhering from
Template::Stash::Filter that would inherit from Template::STashe::XS
or something else.

Other configuration options could trigger other extensions.
Template::Stash::Custom would have the magic to set up its inheritence
based on the configuration.


This would allow for other options to get a stash that doesn't clone
data and doesn't have the hash / object magic.

-- 
/ Jonas  -  http://jonas.liljegren.org/myself/en/index.html