const mixinafEfan::EfanRenderer

afEfan::EfanRenderer

Represents a compiled efan template. Returned from EfanCompiler.

efanMetaData

Source

abstract EfanMetaData efanMetaData

Meta data about the compiled efan templates

render

Source

virtual Str render(Obj? ctx)

The main render method.

Renders the efan template to a Str, passing in the given ctx (which must fit ctxType).

renderBody

Source

virtual Void renderBody()

Renders the body of the enclosing efan template. Example, a layout.html may be defined as:

<html>
<head>
  <title><%= ctx.pageTitle %>
</html>
<body>
    <div class="wotever">
      <% renderBody() %>
    </div>
</html>
renderEfan

Source

virtual Void renderEfan(EfanRenderer renderer, Obj? rendererCtx := null, |EfanRenderer? bodyFunc := null)

Renders the given nested efan template. Use when you want to enclose content in an outer efan template. The content will be rendered whenever the renderer calls renderBody(). Example:

...
<% renderEfan(ctx.layout, ctx.layoutCtx) { %>
  ... my main content ...
<% } %>
...