On Tue, 20 Jul 2004, Dave Cross wrote:

Thanks Dave.  I was just puzzling my way through Peter's response and was
thrown for a bit by the ' _ var _ ' he syntax used.  Trying to make me
think, I think.  :-)

This will be my first foreach loop using TT (I'm working my way slowly up
the food chain.)  When I first started using perl some 8 or so years ago
(no guru here just a _really_ big fan) I sometimes got lost in the 
simplicity of doing stuff.  I was seeing the forest but not the trees.  
Seems it is the same here.

> Something like this perhaps:
> 
>   [% days = [ 3, 7, 14, 30 ] %]
>   [% FOREACH day IN days -%]
>   <input type="radio" name="keepdays" value="[% day %]"
>     [%- IF keepday == day %] checked="checked"[% END %]/>[% day %]
>   [% END %]

Yes!  Way slick.  In retrospect and looking at the Badger book I see a
simpler example (pg 150) that makes this even clearer.  that damn forest
keeps getting in the way.  Plus I've been thinking in the (fill in the)
template mode not the programing mode.


Again thanks,
Rod
-- 
    "Open Source Software - You usually get more than you pay for..."
     "Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"



_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to