tpl
tiny templating domain (${name} replacement).
Load with: use tpl
Quick example
use tpl
result = tplre("value", "value")
prn(result)
Functions
Functions
tplre(tpl, vars)
Performs the operation. Takes tpl, vars.
tplre(rows, vars)
Performs the operation. Takes rows, vars.
escape interpolated values for HTML context
tplht(vars)
Performs the operation. Takes vars.
tplre(tpl, vars)
Performs the operation. Takes tpl, vars.
Advanced Template Engine
tplne(source)
Creates a new instance. Takes source.
tplfr(path)
Creates from another format. Takes path.
Compilation
tplco(template)
Connects. Takes template.
Rendering
tplre(template, context)
Performs the operation. Takes template, context.
Variable access
tplge(context, path)
Gets or retrieves a value. Takes context, path.
Partials/layouts
tplla(layout_path, blocks)
Performs the operation. Takes layout_path, blocks.
Helper functions
tplhe(format, timestamp)
Performs the operation. Takes format, timestamp.
tplhe(amount, currency_code)
Performs the operation. Takes amount, currency_code.
tplhe(num, decimals)
Performs the operation. Takes num, decimals.
tplhe(count, singular, plural)
Performs the operation. Takes count, singular, plural.
tplhe(text, length, suffix)
Performs the operation. Takes text, length, suffix.
Notes
- Template helpers - alias for
tmpl.