[Catalyst] Re: Catalyst videos from YAPC::Asia

A. Pagaltzis pagaltzis at gmx.de
Thu Apr 26 11:38:07 GMT 2007


* Danny Warren <danny at io.com> [2007-04-26 11:25]:
> A. Pagaltzis wrote:
> >* Danny Warren <danny at io.com> [2007-04-26 04:45]:
> >>Quick question: at around 15 minutes in (while discussing TT)
> >>you mentioned the ability to set html scrubbing at a global
> >>level, and that there is something on CPAN to assist with
> >>this.
> >>
> >>I am interested in seeing what you were talking about, as I
> >>am about to go through and add '| html' to damn near every
> >>variable in my templates. 
> >
> >http://search.cpan.org/dist/Template-Stash-HTML-Entities/
> 
> Perfect, thank you!  Not sure how I missed that one in all my
> searching...

To be fair, I don’t think it’s perfect. It provides no escape
hatch (pun intended) at all, nor does it provide a mechanism to
pass any of the optional arguments to `encode` or use
`encode_numeric` instead. No surprise that it doesn’t provide a
way to pass in another stash to chain to, either, although you
can hack around that.

This is a works-for-me 5-liner wrapped in a distro and thrown on
CPAN. (Actually a lot of TT-related modules are like that. TT is
simply itself too big and messy.)

However, that’s not such a bad thing in this case. Look at the
source and you’ll find that it is really, really, REALLY trivial.
So just copypaste and tweak to taste.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list