const classafEfan::Efan
sys::Obj afEfan::Efan
Methods for compiling and rendering efan templates. Note these methods are non-caching.
- compileFromFile
EfanTemplate compileFromFile(File efanFile, Type? ctxType := null, Type[]? viewHelpers := null)
Compiles a new template from the given efan
File
.The compiled template extends the given view helper mixins.
- compileFromStr
EfanTemplate compileFromStr(Str efanTemplate, Type? ctxType := null, Type[]? viewHelpers := null, Uri? srcLocation := null)
Compiles a new efan template from the given efan
Str
.The compiled template extends the given view helper mixins.
srcLocation
may be anything - used for meta information only.- renderFromFile
Str renderFromFile(File efanFile, Obj? ctx := null, Type[]? viewHelpers := null)
Compiles and renders the given efan
File
template.- renderFromStr
Str renderFromStr(Str efanTemplate, Obj? ctx := null, Type[]? viewHelpers := null, Uri? srcLocation := null)
Compiles and renders the given efan
Str
template.srcLocation
may be anything - used for meta information only.- renderingStack
static RenderingElement[] renderingStack()
Returns a stack of nested templates that are currently being rendered. Returns an empty list if nothing is being rendered.
The first item in the list is the top level template, and subsequent items represent nested templates.