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

ke han ke.han@REDACTED
Thu Jun 15 09:44:48 CEST 2006


On Jun 15, 2006, at 7:19 AM, Yariv Sadan wrote:

>>
>> Using the ehtml module in yfront (jungerl) you can write the
>> above as:
>>
>> {ehtml, ehtml:table([[E#person.name] || E <-
>> dict:get(people,Data)])}
>>
>
> Tobbe, this example make my previous code look like quite an eye sore
> :) However, the advantage I still see with a template language is that
> it makes it easy (i.e. no Erlang skills needed) to style and tweak the
> table without digging into Erlang code.
>
> OTOH, hacking a simple MVC framework into Yaws using Erlang as a
> template language is probably 1-3 days of work, whereas implementing a
> StringTemplate-like template engine is a bit harder.

That's the bottom line, isn't it.  I am working on an mvc ajax only  
framework with yaws.  I can get an alpha release out in a few more  
days as I do not need templating for this.  I can also cheat and use  
erlang/ehtml for templating in yaws and simply watch how I use it so  
not to violate model-view separation.

But longer term, I think something like StringTemplate is the way to  
go for traditional or "mixed mode" (ajax and templating) apps.

ke han


> In addition, by
> integrating this way with Yaws you get caching for free. Depending on
> the maturity of the various efforts mentioned on this list, I might
> try this temporary hack just for fun :)
>
> Best,
> Yariv




More information about the erlang-questions mailing list