[Templates] Auto-increment?
Paul Seamons
mail@seamons.com
Tue, 12 Sep 2006 11:19:03 -0600
On Monday 11 September 2006 12:10 pm, Roderick A. Anderson wrote:
> Is there a method to increment a value and have it return that value?
> I've been through the Badger Book but didn't quite see what I was
> needing though MACRO seemed close. This is for a View for a Catalyst
> based application if that makes a difference.
[% ++val %]
[% val++ %]
[% --val %]
[% val-- %]
Will be supported in TT3. They are not available in TT2. They are available
in CGI::Ex::Template (part of CGI::Ex) which does the majority of TT2 and
much of TT3.
[paul@www1 ~]$ perl -e 'use CGI::Ex::Template;
CGI::Ex::Template->new->process(\"[% a++ %][% a++ %][% --a %]\n")'
011
Paul Seamons