On Sun, Oct 07, 2007 at 09:40:37PM +0100, Paul Makepeace wrote: > I'm wondering if there's been any discussion on augmenting TT with a > pythonic (and many others) IN keyword. Allowing something awesomely > compact and readable like,
"IN" is already used. $ perl -MTemplate -le 'Template->new->process( \"[% x FOR x IN [1,2,3] %]" )' 123 > > <input type="checkbox" name="[% name %]" value="[% val %]" > [% IF val IN c.req.param(name); 'checked="checked"'; END %] /> > > I'm at a loss how to achieve that without building up a hash. Any tips? Hash is the way, I'd think. But, the tip I would give is to use one of the many form generation and validation modules to do all that work for you. Form processing is so common it's nice to abstract it out a bit. -- Bill Moseley [EMAIL PROTECTED] _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
