in reply to Re: Toolkit::Template - uc() and lc(), other simple formatting mutexes
in thread Template::Toolkit - uc() and lc(), other simple formatting mutators - see TT Filters!
Doh! and fab! many thanks, I knew I was missing something!
And this shows me how to easily create new TT filters in the Catalyst framework... (eg commify ucwords etc!) http://readlist.com/lists/lists.rawmode.org/catalyst/2/11553.html
Many many thank Monks!package myApp::View::TT; use strict; use base 'Catalyst::View::TT'; __PACKAGE__->config({ CATALYST_VAR => 'catalyst', ... FILTERS => { yesno => sub { $_[0] ? 'yes' : 'no'; }, onoff => sub { $_[0] ? 'on' : 'off'; }, }, });
|
|---|