const classafSlim::Slim
sys::Obj afSlim::Slim
(Service) - Non-caching service methods for parsing and compiling Slim templates efan templates, and for rendering HTML.
For further information on the ctx parameter, see efan: Template Context
Note: This class is available as a service in IoC v3 under the root scope with an ID of afSlim::Slim.
- compileFromFile
EfanMeta compileFromFile(File slimFile, Type? ctxType := null, Type[]? viewHelpers := null)Compiles a renderer from the given slim file.
- compileFromStr
EfanMeta compileFromStr(Str slimTemplate, Type? ctxType := null, Type[]? viewHelpers := null, Uri? srcLocation := null)Compiles a renderer from the given slim template.
srcLocationmay be anything - it is used for meta information only.- make
new make(SlimComponent[]? components := null, TagStyle tagStyle := TagStyle.html)Creates a
Sliminstance, setting the ending style for tags.tagStyledefaults toTagStyle.html.- parseFromFile
Str parseFromFile(File slimFile)Parses the given slim file into an efan template.
- parseFromStr
Str parseFromStr(Str slimTemplate, Uri? srcLocation := null)Parses the given slim template into an efan template.
srcLocationmay anything - used for meta information only.- renderFromFile
Str renderFromFile(File slimFile, Obj? ctx := null, Type[]? viewHelpers := null)Renders the given slim template file into HTML.
- renderFromStr
Str renderFromStr(Str slimTemplate, Obj? ctx := null, Type[]? viewHelpers := null, Uri? srcLocation := null)Renders the given slim template into HTML.
srcLocationmay anything - used for meta information only.- tagStyle
const TagStyle tagStyleThe void tag ending style for compiled templates