Documentation
¶
Overview ¶
Package html 提供输出 HTML 内容的 encoding.MarshalFunc 函数。
tpl := template.ParseFiles(...)
mgr := html.New(tpl)
encoding.AddMarshal("text/html", mgr.Marshal)
func handle(w http.ResponseWriter, r *http.Request) {
ctx := web.New(w, r)
ctx.Render(html.Tpl("index", map[string]interface{}{...}))
}
Index ¶
Constants ¶
View Source
const MimeType = "text/html"
MimeType HTML 的 mimetype 值
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTML ¶
type HTML struct {
// contains filtered or unexported fields
}
HTML 模板管理
Click to show internal directories.
Click to hide internal directories.