MCPcopy
hub / github.com/gin-gonic/gin / SetHTMLTemplate

Method SetHTMLTemplate

gin.go:312–318  ·  view source on GitHub ↗

SetHTMLTemplate associate a template with HTML renderer.

(templ *template.Template)

Source from the content-addressed store, hash-verified

310
311// SetHTMLTemplate associate a template with HTML renderer.
312func (engine *Engine) SetHTMLTemplate(templ *template.Template) {
313 if len(engine.trees) > 0 {
314 debugPrintWARNINGSetHTMLTemplate()
315 }
316
317 engine.HTMLRender = render.HTMLProduction{Template: templ.Funcs(engine.FuncMap)}
318}
319
320// SetFuncMap sets the FuncMap used for template.FuncMap.
321func (engine *Engine) SetFuncMap(funcMap template.FuncMap) {

Callers 10

LoadHTMLGlobMethod · 0.95
LoadHTMLFilesMethod · 0.95
LoadHTMLFSMethod · 0.95
TestContextRenderHTMLFunction · 0.80
TestContextRenderHTML2Function · 0.80
TestPusherFunction · 0.80
BenchmarkOneRouteHTMLFunction · 0.80
SetHTMLTemplateFunction · 0.80

Calls 1

Tested by 6

TestContextRenderHTMLFunction · 0.64
TestContextRenderHTML2Function · 0.64
TestPusherFunction · 0.64
BenchmarkOneRouteHTMLFunction · 0.64