mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 19:57:40 +08:00
模板引擎示例代码
This commit is contained in:
parent
855cb59caf
commit
4bcde5c999
@ -4,6 +4,7 @@ import (
|
||||
"gitee.com/johng/gf/g/net/ghttp"
|
||||
"gitee.com/johng/gf/g/frame/gmvc"
|
||||
"gitee.com/johng/gf/g/frame/gins"
|
||||
"gitee.com/johng/gf/g/os/gview"
|
||||
)
|
||||
|
||||
type ControllerTemplate struct {
|
||||
@ -11,8 +12,12 @@ type ControllerTemplate struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
gins.View().
|
||||
ghttp.GetServer().BindController("/template", &ControllerTemplate{})
|
||||
ghttp.GetServer().BindHandler("/template/handler-info", Info)
|
||||
ghttp.GetServer().BindControllerMethod("/template/ctl-info", &ControllerTemplate{}, "Info")
|
||||
}
|
||||
|
||||
func Info(r *ghttp.Request) {
|
||||
gins.View().SetPath("")
|
||||
}
|
||||
|
||||
func (c *ControllerTemplate) Info() {
|
||||
|
Loading…
Reference in New Issue
Block a user