mirror of
https://gitee.com/johng/gf
synced 2026-06-07 10:22:11 +08:00
24 lines
378 B
Go
24 lines
378 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/frame/gmvc"
|
|
)
|
|
|
|
type Controller struct {
|
|
gmvc.Controller
|
|
}
|
|
|
|
func (c *Controller) Index() {
|
|
c.View.Assign("name", "john")
|
|
c.View.Assign("mainTpl", "main/main2.html")
|
|
c.View.Display("layout.html")
|
|
}
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
s.BindController("/view", new(Controller))
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|