Rob Nagler wrote:
> [Skirting on the edge of YATW. :-]

I certainly don't mean to have a templating war.  I'm just trying to 
figure out what the difference is between these approaches and if 
there's something I've been missing that I should consider adding to 
future applications.

> Here's your expanded example in widgets:
> 
>     String(Prose(<<'EOF'), 'basic_info_font');
>     Hello String(['Model.User', 'first_name']);!<br>
>     If(['Model.AccountList', '->get_result_set_size'],
>       Join([
>           "You have these accounts:<br>",
>           Table('Model.AccountList', [
>               'name',
>               'balance',
>           ]),
>       ]),
>     );
>     EOF

If your String widget can accept other widgets recursively like this, 
then our examples are equivalent.  I thought it was limited to a simple 
value.

> Unless I
> missing something, the template example won't align properly in HTML.
> This is a significant semantic difference between FOREACH and
> Table.

I just didn't put in any fancy HTML in my example.  I could have put in 
table tags right there, or made a macro if that table gets repeated a 
lot.  Looks to me like they work the same.  In TT, I would probably use 
macros or small templates (possibly defined in this same template file 
at the top) for little repeating chunks, and filters or plugins for 
things with more brains, like the String widget that decides whether or 
not it needs to print FONT tags.

- Perrin

Reply via email to