Re: [Templates] Perl to TT question

[prev] [thread] [next] [Date index for 2004/10/28]

From: Andy Lester
Subject: Re: [Templates] Perl to TT question
Date: 12:16 on 28 Oct 2004
>
>
> [% count = 0;
>     WHILE ($sth->fetchrow_arrayref) %]
>         [% IF ($count % 2) %]
>             print "something";
>         [% ELSE %]
>             print "something else";
>         [% END %]
>     count++;
> [% END %]

Yes, that's correct.

And, if you're trying to print alternating background colors for your 
rows, please just set a variable for the color, rather than having two 
nearly identical print statements.

Further, printing background colors is an ideal use of Tie::Cycle.

xoxo,
Andy

--
Andy Lester => andy@xxxxxxxx.xxx => www.petdance.com => AIM:petdance


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Perl to TT question
Robert 16:45 on 19 Oct 2004

Re: [Templates] Perl to TT question
lio 10:37 on 28 Oct 2004

Re: [Templates] Perl to TT question
Andy Lester 12:16 on 28 Oct 2004

Re: [Templates] Perl to TT question
Stephen Quinney 12:37 on 28 Oct 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52