const classafEfan::EfanCompiler

sys::Obj
  afEfan::EfanCompiler

Compiles efan templates into EfanRenderer classes. Call render() to render the efan template into a Str.

template := ...
renderer := EfanCompiler().compile(`index.efan`, template)
htmlStr  := renderer.render(...)
compile

Source

EfanRenderer compile(Uri srcLocation, Str efanTemplate, Type? ctxType := null, Type[] viewHelpers := Type[])Type#.emptyList()

Standard compilation usage; compiles a new renderer from the given efanTemplate. The compiled renderer extends the given view helper mixins.

This method compiles a new Fantom Type so use judiciously to avoid memory leaks. srcLocation is only used for reporting Err msgs.

compileWithModel

Source

Obj compileWithModel(Uri srcLocation, Str efanTemplate, Type? ctxType, PlasticClassModel model, |Type,EfanMetaData->BaseEfanImpl? makeFunc := null)

Advanced compiler usage; the efan render methods are added to the given afPlastic model.

The (optional) makeFunc is used to create an EfanRenderer instance from the supplied Type and meta data.

This method compiles a new Fantom Type so use judiciously to avoid memory leaks. srcLocation is only used for reporting Err msgs.

ctxVarName

Source

const Str ctxVarName := "ctx"

The name given to the ctx variable in the render method.

make

Source

new make(|This? in := null)

Create an EfanCompiler.

makeWithServices

Source

new makeWithServices(PlasticCompiler plasticCompiler, |This? in := null)

For use by afIoc.

plasticCompiler

Source

const PlasticCompiler plasticCompiler

Expose PlasticCompiler so it (and it's mutable srcCodePadding value) may be re-used by other projects, such as afSlim.

rendererClassName

Source

const Str rendererClassName := "EfanRendererImpl"

The class name given to compiled efan renderer instances.