On 1/29/06, Paul Makepeace <[EMAIL PROTECTED]> wrote: > Je 2006-01-29 18:36:09 +0000, Simon Wilcox skribis: > > Isn't that extra space in there explicitly ? Shouldn't you write > > > > <td> > > [% IF 1 %] > > <img src="foo.jpg"> > > [% END %] > > </td> > > > > i.e. with no indent of the img tag ? > > Yeah, that's one way but I hardly ever see unindented HTML or unindented > template code (and wouldn't want to maintain that anyway!). Besides it > would also require a degree of rewriting of the code and partly this > exercise is to demonstrate how easy it is to convert PHP to Template ;)
Just curious, but how does PHP handle this? I thought that it never touched anything outside the <? ?> tags (I haven't used it since the 90s, so my knowledge of it is very outdated). If you wrote this HTML page without any dynamic elements, you would be forced to write it like this: <td><img src="foo.jpg"></td> So why not do the same with the dynamic code: <td>[% IF 1 %]<img src="foo.jpg">[% END %]</td> I know that can get kind of busy if you have a long IF condition, but you can always break the code inside the [% %] up over multipl lines... Cheers, Cees _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
