[Nitro] Nitro and Amrita

David Corbin dcorbin at machturtle.com
Sun Apr 16 14:42:57 EDT 2006


On Sunday 16 April 2006 01:14 pm, George Moschovitis wrote:
> > I wouldn't neccessarily say that b/c Amrita is different from Nitro's
> > templates. Nitro's templates are more like PHPs, while Amrita
> > completely separates layout from data.
>
> NOT really. Nitro Templates can be used in PHP like mode and/or Amrita
> style mode. Have a look at this.
>
>
> def action
>   @user = User.current_user
>   @name = @user.name
>   @articles = @user.articles
>   @something =...
> end
>
> action.xhtml
>
> <div if="@user.admin">
>   <p>#@name</p>
>   <ul for="a in @articles">
>      <li>#{a.title}</li>
>   <
> </div>
>
> This is fully separated layout from data.

I'm a touch out of date with Amrita, but I think it also has the benfit that 
the template is valid X?HTML.  Your example is not.  This can be very handy  
you have to work with "designers", or some 'tool' that requires X?HTML.




More information about the Nitro-general mailing list