You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-fly/tmpl/index.go

23 lines
665 B

package tmpl
import (
"github.com/taoshihan1991/imaptool/tools"
"html/template"
"net/http"
)
func RenderList(w http.ResponseWriter, render interface{}) {
header := tools.FileGetContent("html/header.html")
html := tools.FileGetContent("html/list.html")
t, _ := template.New("list").Parse(html)
render.(*tools.IndexData).Header=template.HTML(header)
t.Execute(w, render)
}
func RenderWrite(w http.ResponseWriter, render interface{}){
header := tools.FileGetContent("html/header.html")
html := tools.FileGetContent("html/write.html")
t, _ := template.New("write").Parse(html)
render.(*tools.ViewHtml).Header=template.HTML(header)
t.Execute(w, render)
}