Skip to content

Template

Template Storage

Server-side templates are stored in the /home/coronium/templates directory. They have no relation to the Pages templates.

For detailed information on how to work with templates, see the Templates section of the Pages guide.

render

Render a template based on a passed key/value table. Returns String.

core.template.render(tpl_file, tpl_data)

Parameters

Name Description Type Required
tpl_file The template file to render relative to the templates directory. String Y
tpl_data A table of key/value pairs to populate the template file. Table Y

Example

local compiled_str = core.template.render('common_resp.tpl', {
  name = "Jenny",
  age = 23
})