mixinafEfanXtra::EfanComponent

afEfanXtra::EfanComponent

Implement to define an efanXtra component.

Whereas efan has EfanRenderer instances, efanXtra has EfanComponent instances.

componentId

Source

Str componentId()

Returns a unique ID for this component based on the lib and type name.

efanMeta

Source

EfanMeta efanMeta()

Meta data about the compiled efan templates

render

Source

Str render(Obj?[]? initArgs := null, |->Void? bodyFunc := null)

The main render method. initArgs are passed to the @InitRender lifecycle method.

In normal use, bodyFunc is only passed from within a template. It is executed when renderBody() is called. Use it for enclosing content in Layout templates. Example:

...
<%= app.renderLayout() { %>
  ... my body content ...
<% } %>
...
renderBody

Source

Str renderBody()

Call from within your template to render the body of the enclosing efan template. Example, a simple layout efan template may look like:

<html>
<body>
    <%= renderBody() %>
</body>
</html>
renderTemplate

Source

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.