mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
修复gtcp.PoolConn方法覆盖问题
This commit is contained in:
@ -11,7 +11,6 @@ import (
|
||||
"time"
|
||||
"io"
|
||||
"bufio"
|
||||
"strings"
|
||||
"bytes"
|
||||
)
|
||||
|
||||
|
||||
39
geg/util/gpage/gpage_static2.go
Normal file
39
geg/util/gpage/gpage_static2.go
Normal file
@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gitee.com/johng/gf/g"
|
||||
"gitee.com/johng/gf/g/os/gview"
|
||||
"gitee.com/johng/gf/g/net/ghttp"
|
||||
"gitee.com/johng/gf/g/util/gpage"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := g.Server()
|
||||
s.BindHandler("/page/template/{page}.html", func(r *ghttp.Request){
|
||||
page := gpage.New(100, 10, r.Get("page"), r.URL.String(), r.Router)
|
||||
buffer, _ := gview.ParseContent(`
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
a,span {padding:8px; font-size:16px;}
|
||||
div{margin:5px 5px 20px 5px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>{{.page1}}</div>
|
||||
<div>{{.page2}}</div>
|
||||
<div>{{.page3}}</div>
|
||||
<div>{{.page4}}</div>
|
||||
</body>
|
||||
</html>
|
||||
`, g.Map{
|
||||
"page1" : gview.HTML(page.GetContent(1)),
|
||||
"page2" : gview.HTML(page.GetContent(2)),
|
||||
"page3" : gview.HTML(page.GetContent(3)),
|
||||
"page4" : gview.HTML(page.GetContent(4)),
|
||||
})
|
||||
r.Response.Write(buffer)
|
||||
})
|
||||
s.SetPort(8199)
|
||||
s.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user