package main import ( "github.com/gogf/gf/frame/g" "github.com/gogf/gf/net/ghttp" "github.com/gogf/gf/os/gview" ) func main() { s := g.Server() s.BindHandler("/page/demo", func(r *ghttp.Request) { page := r.GetPage(100, 10) buffer, _ := gview.ParseContent(`
{{.page1}}
{{.page2}}
{{.page3}}
{{.page4}}
`, g.Map{ "page1": page.GetContent(1), "page2": page.GetContent(2), "page3": page.GetContent(3), "page4": page.GetContent(4), }) r.Response.Write(buffer) }) s.SetPort(8199) s.Run() }