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
- 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. - srcLocationis only used for reporting Err msgs.
- compileWithModel
- 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) - makeFuncis used to create an- EfanRendererinstance from the supplied Type and meta data.- This method compiles a new Fantom Type so use judiciously to avoid memory leaks. - srcLocationis only used for reporting Err msgs.
- ctxVarName
- const Str ctxVarName := "ctx"- The name given to the - ctxvariable in the render method.
- make
- new make(|This? in := null)- Create an - EfanCompiler.
- makeWithServices
- new makeWithServices(PlasticCompiler plasticCompiler, |This? in := null)- For use by afIoc. 
- plasticCompiler
- const PlasticCompiler plasticCompiler- Expose - PlasticCompilerso it (and it's mutable srcCodePadding value) may be re-used by other projects, such as afSlim.
- rendererClassName
- const Str rendererClassName := "EfanRendererImpl"- The class name given to compiled efan renderer instances.