compile()¶
Compile a template string into a reusable renderable object.
Signature¶
Parameters¶
| Parameter | Type | Description |
|-----------|------|-------------|
| templateStr | string | Template source string |
| options | object | Options including views directories |
Returns¶
An object with these render methods:
| Method | Description |
|--------|-------------|
| render(contextObj, callOptions) | Synchronous render |
| renderWith(contextObj, callOptions) | Render with options override |
| asyncRender(contextObj) | Asynchronous render (supports async filters/tags) |
| asyncRenderWith(contextObj, callOptions) | Async render with options override |
| renderBlock(blockName, contextObj) | Render a single {% block %} |
| renderPartial(partialName, contextObj) | Render a named {% partialdef %} |