Loading

TEMPLATE

strings

TEMPLATE fills a template with values contained in a map. See example for syntax help.

The TEMPLATE function expects the map of values on top of the stack and will operate on the string template below it.

Values speficied with {{key}} will be url-escaped. If you do not want that behavior, use {{{key}}}.

TEMPLATE is available since version 1.0.0.

See also

Signatures

Examples

//simple map ' {{p1}} {{p2}} {{p3}} x {{p4}} x' //if any spaces before or after {{}}, will be replaced by one { 'p1' 'user' 'p2' 28.0 'p3' True } TEMPLATE
//map with list of maps ' {{userlist}} {{#userdata}} {{name}}, {{age}} years old. {{/userdata}} ' { 'userlist' 'List of users:' 'userdata' [ { 'name' 'Peter' 'age' 42 } { 'name' 'Steven' 'age' 35 } { 'name' 'Dave' 'age' 28.5 } { 'name' 'George' 'age' NaN } ] } TEMPLATE