> <ul>
> [% FOREACH d = array %]
> <li>[% d %]</li>
> [% END %]
> </ul>

You might also write that:
<ul>
[% "<li>$d</li>" FOREACH d = array %]
</ul>
 
> But something like
> 
> [% cgi.start_ul();
>     FOREACH d = array;
>     cgi.li("$d");
>     END;
>     cgi.end_ul()
> %]
> 
> is probably simpler.

That is only "simpler" for extreme values of "simple". =) "cgi.start_ul()" is just a 
really hard way to type "<ul>", no matter how you paint it.

One of the real benefits I see with templating HTML is being able to load the raw 
template and at least see a version of the page. Maybe if the cgi plugin did some 
other level of correctness checking (not allowing .li except within ul() or related 
containers) it would be worth losing the "viewability" but for now I'm suprised to 
find that people do that on a regular basis.

Now, OTOH, I can't imagine dealing with cgi forms without the plugin so I shouldn't be 
so surprised. =)

If I were to use the cgi plugin for lists, I'd still be doing:
<ul>
[% cgi.li(d) FOREACH d = array %]
</ul>


Reply via email to