TemplateFunctionThis interface

An object used to render plugin defined template functions, passed as this when the implementing function is called.

Construction

TemplateFunctionThis object are automatically created by the templates rendering system. The objects may be reused for efficiency, but your implementation must make no assumptions.

Interface

property functionName

The name of the function being rendered.

function write(string)

Write the string, escaped for the current context.

function hasBlock(blockName)

Return true if the function has been called with a given named block, or null for the anonymous block.

function writeBlock(blockName)

Write the given named block, or null for the anonymous block.

function render(thing)

Render something. thing may be a deferred render or a template.

function unsafeWriteHTML(html)

Output the html without any escaping. Use with care.

function assertContext(context)

Assert that the function is being called in the right HTML context. context may be "TEXT" or "ATTRIBUTE_VALUE".