Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: default_escape for Template::Toolkit?

by pc88mxer (Vicar)
on Apr 15, 2008 at 17:25 UTC ( #680585=note: print w/replies, xml ) Need Help??

in reply to default_escape for Template::Toolkit?

I created a patch for this about six months ago and discussed it on the TT mailing list. It allows you to write:
[% GETFILTER '::html_escape' %] ... all gets are now filtered through the function ::html_escape ... Hello, [% name %] [% GETFILTER '' %] ... turn off filtering ... [% END %] ... previous filtering resumes ... [% END %]
It maintains a stack of filters, and there's no reason why you couldn't pre-initialize it with a default filter.

At the time it seemed to generate some interest, although not enough for me to do much more with it. Perhaps by now some form of it has made it's way into the latest release - I haven't checked.

Replies are listed 'Best First'.
Re^2: default_escape for Template::Toolkit?
by moritz (Cardinal) on Apr 15, 2008 at 17:34 UTC
    Perhaps by now some form of it has made it's way into the latest release - I haven't checked.

    I grepped the latest release for 'getfilter', no results. So it doesn't seem to be implemented, or at least not with that syntax. I didn't find anything in the Changes file either.

    Thanks for your response anyway.

      It's trivial to implement. Check out the TT mailing list archives for Nov 2007.

      I'm not sure why there wasn't more interest in it. I think this capability would be a great boon for creating robust HTML using TT.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://680585]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2023-02-06 13:00 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (34 votes). Check out past polls.