tpl
Generated by tinox doc
tinox.core.tpl, split out of the bundled stdlib as a standalone tinox-central package.
| Module | Version | Group |
|---|---|---|
json (no local docs) | 1.1.7 | tinox.core |
Render placeholders
import tinox.core.tpl
import tinox.core.json
class Main
{
fnc main() -> Int32
{
let data: Map<String, JsonValue> = Map::new()
data["name"] = Json::parse("\"World\"")
let output: String = Template::render("Hello, {{name}}!", data)
println(output)
return 0
}
}
class CompiledTemplate
Fields
source | String | |
sections | List<TemplateSection> |
class Template
Methods
fn render(template: String, data: Map<String, JsonValue>) → String
fn renderLoop(template: String, items: List<Map<String, JsonValue>>, itemVar: String) → String
fn compile(template: String) → CompiledTemplate
fn execute(tpl: CompiledTemplate, data: Map<String, JsonValue>) → String
class TemplateSection
Fields
kind | String | |
content | String |