in reply to Template::Toolkit - uc() and lc(), other simple formatting mutators - see TT Filters!

You have not found the right docs assuming you mean Template::Toolkit not Toolkit::Template which AFAIK does not exist. There are a swag of standard FILTERs you can use.

[% "hello world!" FILTER ucfirst %]
  • Comment on Re: Toolkit::Template - uc() and lc(), other simple formatting mutexes
  • Download Code

Replies are listed 'Best First'.
Re^2: Toolkit::Template - uc() and lc(), other simple formatting mutexes
by jaa (Friar) on Apr 23, 2008 at 12:43 UTC

    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

    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'; }, }, });
    Many many thank Monks!