How To Dynamic Web Rendering?
Jacob Carlborg
doob at me.com
Sun May 15 06:39:30 PDT 2011
On 2011-05-14 04:17, Adam D. Ruppe wrote:
>> I haven't used it yet, but I think you've got the right approach
>> with your DOM stuff.
>
> For people who haven't read about this, I just wrote up a quick
> document about it:
>
> http://arsdnet.net/web.d/dom.html
>
> I really rambled at points, but I wanted to cover all the bases.
I can agree with some of this but not all of it. I quite like Rails'
Model-View-Controller pattern which allows the view layer to contain
logic but which you should try to avoid as much as possible. I guess
this fall under "PHP (Disciplined)".
I don't see anything wrong with the view layer containing simple logic,
like this (written in HAML):
%ul
- @posts.each do |post|
%li= post.title
Or, if you prefer, you can a partial:
posts.html.haml:
%ul
= render @posts
_post.html.haml:
%li= post.title
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list