RFC: template engine [ was: Re: Implementing tables - advice wanted ]

Yariv Sadan yarivvv@REDACTED
Wed Jun 14 21:10:56 CEST 2006


> according to StringTemplate syntax, your example can be written more
> clearly, IMO:
>
> <table>
> $people:row()$
> </table>
>
> where row() is defined as:
> <tr><rd width=20>$attr.name$</td></tr>
>
>
> - or -  if you feel like putting it together as one:
>
> <table>
> $people: {
>         <tr><td width=20>$attr.name$</td></tr>
> }$
> </table>
>
> I think if you read the pdf referred in this thread, you can see the
> rational for not using erlang as the template language but in favor
> of using erlang for all the behavior needed elsewhere such as the
> controllers, models, and renderers.  In other words, "if
> StringTemplate can't easily help you construct your view, then you
> shouldn't be coding that behavior in the view".
>

Ke Han,

I admit I haven't fully read the PDF before I wrote my last email...
:) I agree that the StringTemplate code is looks much better than the
ehtml code. I will try to think of cases where an Erlang template
language would clearly be superior to StringTemplate... If I can't
think of such cases, or nobody points one out to me, I may very well
turn into a StringTemplate convert.

Best,
Yariv



More information about the erlang-questions mailing list