Returns a new template instance from a given string.
This function does not generate a change.
template(str)
| Argument | Type | Description |
|---|---|---|
str |
str |
The raw template string containing embedded ThingsDB expressions enclosed in curly brackets ({...}). |
Returns a new template value.
This code creates a
templateand renders it using.render():
tpl = template('The sum of {a} plus {b} is {a + b}.');
a = 6; b = 7;
tpl.render();
Return value in JSON format
"The sum of 6 plus 7 is 13."