Files
gf/geg/net/ghttp/server/controller/user.go
2019-04-03 00:03:46 +08:00

28 lines
433 B
Go

package main
import (
"github.com/gogf/gf/g"
"github.com/gogf/gf/g/frame/gmvc"
)
type User struct {
gmvc.Controller
}
func (c *User) Index() {
c.View.Display("index.html")
}
// 不符合规范,不会被自动注册
func (c *User) Test(value interface{}) {
c.View.Display("index.html")
}
func main() {
//g.View().SetPath("C:/www/static")
s := g.Server()
s.BindController("/user", new(User))
s.SetPort(8199)
s.Run()
}