[Rg 131] Re: [PATCH] update the Amrita2 (2.0.0) template engine
Michael Fellinger
m.fellinger at gmail.com
Sun Jan 20 03:39:41 EST 2008
On Jan 20, 2008 5:30 PM, Keita Yamaguchi <keita.yamaguchi at gmail.com> wrote:
> Hi,
>
> This is a patch for updating Amrita2 template engine of Ramaze.
Thank you very much, saves me the trouble of trying to wrap my head
around amrita2 again ^^;
Patch applied.
^ manveru
> Amrita2 version 2.0.0 was released at 2008/01/16, it changed API and
> added some features from version 1.9.x.
>
> Example:
>
> class MyController < Ramaze::Controller
> def index
> # @data is used as model data for rendering.
> # Almost all objects(Hash, Array, String, etc.) can be model data.
> @data = {:one => 1, :two => 2}
> # AmXML with erb
> "<<:one>> + <<:two>> = <%= $_[:one] + $_[:two] %>"
> # => "1 + 2 = 3"
> end
>
> def am_src
> @data = {:title = "hello"}
> # Amrita1 style using the attribute "am:src"
> "<h1 am:src='title'/>"
> end
>
>
> end
>
> Regards,
> Keita Yamaguchi
More information about the Ramaze-general
mailing list