mixinafEfanXtra::EfanComponent
afEfanXtra::EfanComponent
Implement to define an efanXtra component.
Whereas efan has EfanRenderer instances, efanXtra has EfanComponent instances.
- componentId
Str componentId()Returns a unique ID for this component based on the lib and type name.
- efanMeta
EfanMeta efanMeta()Meta data about the compiled efan templates
- render
Str render(Obj?[]? initArgs := null, |->Void? bodyFunc := null)The main render method.
initArgsare passed to the@InitRenderlifecycle method.In normal use,
bodyFuncis only passed from within a template. It is executed whenrenderBody()is called. Use it for enclosing content in Layout templates. Example:... <%= app.renderLayout() { %> ... my body content ... <% } %> ...- renderBody
Str renderBody()Call from within your template to render the body of the enclosing efan template. Example, a simple
layoutefan template may look like:<html> <body> <%= renderBody() %> </body> </html>- renderTemplate
virtual Str renderTemplate()Renders the efan template. Not meant to be invoked by you, the user!
Override to bypass template rendering and return your own generated content. Useful for simple components.