const mixinafSlim::SlimComponent

afSlim::SlimComponent

A customisable component for Slim Template rendering.

Implement and pass instances to the Slim ctor.

fromFn

Source

static new fromFn(Str tagName, |Bool,StrBuf,SlimComponentCtx fn)

Create a new SlimComponent from the given func. Use for simple components.

entryExit is true when onEntry() is invoked, and false when onExit() is invoked.

name

Source

abstract Str name()

The tag name this component overrides. May be a regex glob.

onEntry

Source

abstract Void onEntry(StrBuf out, SlimComponentCtx ctx)

Called when the component is to render its opening tags. Write HTML to the given buf.

onExit

Source

abstract Void onExit(StrBuf out, SlimComponentCtx ctx)

Called when the component is to render its closing tags. Write HTML to the given buf.