Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 852 Bytes

File metadata and controls

40 lines (23 loc) · 852 Bytes

Compiles templates into strings

Properties

template.settings

    Describe: By default, uses ERB-style template delimiters, change the following template settings to use alternative delimiters.


Methods

template(text, data, settings)

    Describe: Compiles templates into strings

    Example:

```js template("hello <%= foo %>", {foo:"modjs"}) // => hello modjs ```

template.registerHelper(name, helper)

    Describe: Helpers can be accessed from any context in a template

    Example:

```js template.registerHelper("echo", function(val){ console.log(val); }) ```