Yandlebars
import { Yandlebars } from "https://raw.githubusercontent.com/cybertim/yandlebars/main/mod.ts";
Yet Another Handlebars for Deno
class Yandlebars { }
constructor(config?: HandlebarsConfig);
private compileCache: Map<string, Template>;
private config: HandlebarsConfig;
registerBasicHelper(name: string, func: (value: string) => string);
registerPartial(name: string, template: string);
async render(view: string, context: Record<string, unknown>);
§Properties
§Methods
§
registerBasicHelper(name: string, func: (value: string) => string)
[src]register a basic helper with name as template element
yandlebars.registerBasicHelper("hello", (value: string) => {
return "hello " + value;
});
@param name
@param func