Version: v0.7.1 - Beta.  We welcome contributors & feedback.

Meta.noTemplateMode

Meta.noTemplateMode() -> false

Description

Trigger an exception if the current function was called from a template.

This is to enforce a separation of view logic from back-end logic.

bodyHtml() //= ERROR

tm bodyHtml {
    {{ getData() }}
}

fn getData {
    Meta.noTemplateMode()
}