刀PPT提供免费PPT模板,红色工作报告PPT模板,模板是设计好的PPT模板直接打开编辑即可。
页数:16页
编号:PPT96276
大小:4.39MB
软件:PowerPoint
格式:PPTX
比例:16:9
复制下载:ppt.101dao.com/ppt/ppt-PPT96276.html
据说点“赞”的人很漂亮,点“喜欢”的人很好看,我的饭碗就靠你们了Thanks♪(・ω・)ノ。
们可以使用以下的方式去渲染html
func main() {
router := gin.Default()
router.LoadHTMLGlob("templates/*")
//router.LoadHTMLFiles("templates/template1.html", "templates/template2.html")
router.GET("/index", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"title": "Main website",
})
})
router.Run(":8080")
}
在html中我们可以使用特殊的双花括号来渲染title这个值
<html>
<h1>
{{ .title }}
</h1>
</html>
值得注意的是这种方式并不是gin特有的,而是golang特有的,它还有其他的模板语法。
{{$article := "hello"}}
也可以给变量赋值
{{$article := .ArticleContent}}
{{funcname .arg1 .arg2}}
{{if .condition}}
{{end}}
{{if .condition1}}
{{else if .contition2}}
{{end}}
{{if not .condition}}
{{end}}
{{if and .condition1 .condition2}}
{{end}}
{{if or .condition1 .condition2}}
{{end}}
{{if eq .var1 .var2}}
{{end}}
{{if ne .var1 .var2}}
{{end}}
(less than){{if lt .var1 .var2}}
{{end}}
{{if le .var1 .var2}}
{{end}}
{{if gt .var1 .var2}}
{{end}}
{{if ge .var1 .var2}}
{{end}}
{{range $i, $v := .slice}}
{{end}}
{{template "navbar"}}
、红色党建风爱国主题教育班会:http://www.yomoer.cn/template/detail/7991.html
2、红色党建风年终工作总结计划汇报:http://www.yomoer.cn/template/detail/7990.html
*请认真填写需求信息,我们会在24小时内与您取得联系。