【发布时间】:2015-06-12 03:27:59
【问题描述】:
【问题讨论】:
-
如果您错过了,请阅读
text/template文档。 -
@TimCooper 我确实错过了:O
-
如果您不想将任何数据传递给模板,这将起作用。否则,您可能会执行
{{ template "header" . }}之类的操作。 -
您可以随时分别写出您的页眉、内容和页脚。例如:
headerTPL.Execute(out, data); contentTPL.Execute(out, data); footerTPL.Execute(out, data).
标签: go go-html-template