renderJson


Description:

public string renderJson (JsonValue vars)

Renders the compiled template using a JSON object as variables.

Top-level string values in the JSON object are used as template variables.

Example:

    string tpl = "Hello, " + "{{na" + "me}}!";
var tmpl = Template.compile (tpl);
var json = Json.parse ("{\"name\": \"World\"}");
string result = tmpl.renderJson (json);

Parameters:

vars

JSON object whose string values are used as variables.

Returns:

rendered string.