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

Danny Warren danny at io.com
Thu Apr 26 11:50:02 GMT 2007


A. Pagaltzis wrote:
> * 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,

Sounds like it will work fine for me - I just need a big hammer to 
automatically clean up all my template variables with no effort on my 
part.

I think modules designed to do one task specifically (as this one is) 
are fine that way - no need for added complexity if it gets the job done. ;)

Thanks,
Danny



More information about the Catalyst mailing list