const mixinafSlim::SlimComponent
afSlim::SlimComponent
A customisable component for Slim Template rendering.
Implement and pass instances to the Slim
ctor.
- fromFn
static new fromFn(Str tagName, |Bool,StrBuf,SlimComponentCtx fn)
Create a new
SlimComponent
from the given func. Use for simple components.entryExit
istrue
whenonEntry()
is invoked, andfalse
whenonExit()
is invoked.- name
abstract Str name()
The tag name this component overrides. May be a regex glob.
- onEntry
abstract Void onEntry(StrBuf out, SlimComponentCtx ctx)
Called when the component is to render its opening tags. Write HTML to the given
buf
.- onExit
abstract Void onExit(StrBuf out, SlimComponentCtx ctx)
Called when the component is to render its closing tags. Write HTML to the given
buf
.