Пример #1
0
// render a template, self explanitory
func (self *templateEngine) renderTemplate(name string, obj map[string]interface{}) string {
	t := self.getTemplate(name)
	obj["i18n"] = i18nProvider
	s, err := mustache.Render(t, obj)
	if err == nil {
		return s
	} else {
		return err.Error()
	}
}
Пример #2
0
func RenderTemplate(template string, vars ...interface{}) (string, error) {
	return mustache.Render(template, vars...)
}