remove deprecated functions and fix corresponding unit test cases

This commit is contained in:
John
2019-09-06 17:59:55 +08:00
parent 13e528abb6
commit 96106ace92
16 changed files with 161 additions and 101 deletions

View File

@ -1,21 +1,26 @@
package main
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"github.com/gogf/gf/os/gres"
_ "github.com/gogf/gf/os/gres/testdata"
_ "github.com/gogf/gf/os/gres/testdata/data"
)
func main() {
gres.Dump()
v := g.View()
v.SetPath("files/template/layout1")
v.SetPath("template/layout1")
s := g.Server()
s.SetIndexFolder(true)
s.SetServerRoot("files/root")
s.SetServerRoot("root")
s.BindHookHandler("/*", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
fmt.Println(r.URL.Path, r.IsFileRequest())
})
s.BindHandler("/template", func(r *ghttp.Request) {
r.Response.WriteTpl("layout.html")
})