const classafSlim::Slim

sys::Obj
  afSlim::Slim

Non-caching service methods for parsing, compiling and rendering slim templates into HTML.

For further information on the ctx parameter, see efan: Passing Data

compileFromFile

Source

EfanTemplate compileFromFile(File slimFile, Type? ctxType := null, Type[]? viewHelpers := null)

Compiles a renderer from the given slim file.

compileFromStr

Source

EfanTemplate compileFromStr(Str slimTemplate, Type? ctxType := null, Type[]? viewHelpers := null, Uri? srcLocation := null)

Compiles a renderer from the given slim template.

srcLocation may anything - used for meta information only.

make

Source

new make(TagStyle tagStyle := TagStyle.html)

Creates a Slim instance, setting the ending style for tags.

Defaults to html.

parseFromFile

Source

Str parseFromFile(File slimFile)

Parses the given slim file into an efan template.

parseFromStr

Source

Str parseFromStr(Str slimTemplate, Uri? srcLocation := null)

Parses the given slim template into an efan template.

srcLocation may anything - used for meta information only.

renderFromFile

Source

Str renderFromFile(File slimFile, Obj? ctx := null, Type[]? viewHelpers := null)

Renders the given slim template file into HTML.

renderFromStr

Source

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

Renders the given slim template into HTML.

srcLocation may anything - used for meta information only.

tagStyle

Source

const TagStyle tagStyle

The void tag ending style for compiled templates