str_template
Renders a template string with lowercase placeholders {{.key}} replaced by values from dictionary using Go's template engine (with if and range). Use html=true to wrap in HTML document structure.
str_template(
template,
data,
[html=false]
) -> STRING
Renders a template string with lowercase placeholders {{.key}} replaced by values from dictionary using Go's template engine (with if and range). Use html=true to wrap in HTML document structure.
Syntaxe
var result = str_template(data={Name:"Richnou"}, template="Hello {{.name}}") ;
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
template | yes | - | Template string with {{.Key}} placeholders | |
data | yes | - | Dictionary with replacement values | |
html | - | false | If true, wrap in simple HTML document structure |