const classafEfan::Efan

sys::Obj
  afEfan::Efan

Convenience methods for compiling and rendering efan templates.

str := efan.render("Hello <%= ctx %>!", "Mum")  // --> "Hello Mum!"  
compile

Source

EfanMeta compile(Str efanTemplate, Type? ctxType := null, Type[]? viewHelpers := null, Uri? templateLoc := null)

Compiles the given efan template to a re-usable meta object.

The compiled template (not the returned Meta) extends the given view helper mixins.

templateLoc may be anything - used for meta information only.

render

Source

Str render(Str efanTemplate, Obj? ctx := null, Type[]? viewHelpers := null, Uri? srcLocation := null)

Compiles and renders the given efan Str template.

str := efan.render("Hello <%= ctx %>!", "Mum")  // --> "Hello Mum!"  

Convenience for:

str := efan.compile(...).render(ctx)