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

Method LoadHTMLGlob

gin.go:272–284  ·  view source on GitHub ↗

LoadHTMLGlob loads HTML files identified by glob pattern and associates the result with HTML renderer.

(pattern string)

Source from the content-addressed store, hash-verified

270// LoadHTMLGlob loads HTML files identified by glob pattern
271// and associates the result with HTML renderer.
272func (engine *Engine) LoadHTMLGlob(pattern string) {
273 left := engine.delims.Left
274 right := engine.delims.Right
275 templ := template.Must(template.New("").Delims(left, right).Funcs(engine.FuncMap).ParseGlob(pattern))
276
277 if IsDebugging() {
278 debugPrintLoadTemplate(templ)
279 engine.HTMLRender = render.HTMLDebug{Glob: pattern, FuncMap: engine.FuncMap, Delims: engine.delims}
280 return
281 }
282
283 engine.SetHTMLTemplate(templ)
284}
285
286// LoadHTMLFiles loads a slice of HTML files
287// and associates the result with HTML renderer.

Callers 6

TestLoadHTMLGlobTestModeFunction · 0.80
TestLoadHTMLGlobUsingTLSFunction · 0.80
LoadHTMLGlobFunction · 0.80

Calls 4

SetHTMLTemplateMethod · 0.95
IsDebuggingFunction · 0.85
debugPrintLoadTemplateFunction · 0.85
DelimsMethod · 0.80

Tested by 5

TestLoadHTMLGlobTestModeFunction · 0.64
TestLoadHTMLGlobUsingTLSFunction · 0.64