You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/templates/base.js

16 lines
366 B

app.templates.render = function (name, value, ...args) {
const template = app.templates[name];
if (Array.isArray(value)) {
let result = "";
for (var val of value) {
result += template(val, ...args);
}
return result;
} else if (typeof template === "function") {
return template(value, ...args);
} else {
return template;
}
};