Renderer

Renderer

Renderer class to handle smarty conversions and fetch template- and script-files

Constructor

# new Renderer()

Methods

# (async, static) getCode(tpl) → {Promise.<string>}

Fetches the template and runs NO smarty conversions
Parameters:
Name Type Description
tpl string the template string or a URL
Returns:
the resulting html string
Type
Promise.<string>

# (async, static) getTemplate(tpl, data, languageKey) → {Promise.<string>}

Fetches the template and runs smarty conversions
Parameters:
Name Type Description
tpl string the template string or a URL
data any the data that gets assigned to the smarty
languageKey string the language-code of the language to live-fetch translations that are not yet assigned
Returns:
the converted template as html string
Type
Promise.<string>

# (async, static) smartify(tpl, data, languageKey) → {Promise.<string>}

Runs smarty conversions on a template string
Parameters:
Name Type Description
tpl string the template string
data object a key-value array of data that gets assigned to the smarty
languageKey string the language-code of the language to live-fetch translations that are not yet assigned
Returns:
the converted template as html string
Type
Promise.<string>