的模板,并给模板赋值 c.HTML(http.StatusOK, "/web/a/index.html", gin.H{ "title": "gin框架之HTML模板渲染-a",..., "/web/b/index.html", gin.H{ "title": "gin框架之HTML模板渲染-b", }) }) router.GET("/func", func(c...*gin.Context) { //加载名称为/web/func/index.html,并给模板赋值 c.HTML(http.StatusOK, "/web/func/index.html...", gin.H{ "title": "gin框架之HTML模板渲染- ", }) }) router.Run(":8080")}
1、更改gin的模板渲染
func init(...,例如/web/a/index.html,这个就是一个模板的名称。