mirror of
https://gitee.com/johng/gf
synced 2026-07-08 14:39:50 +08:00
improving gview with ghttp for controller
This commit is contained in:
@ -1 +1,2 @@
|
||||
<h1>MAIN1</h1>
|
||||
<h1>MAIN1</h1>
|
||||
<h1>Name: {{.name}}</h1>
|
||||
@ -1 +1,2 @@
|
||||
<h1>MAIN2</h1>
|
||||
<h1>MAIN2</h1>
|
||||
<h1>Name: {{.name}}</h1>
|
||||
@ -10,11 +10,8 @@ type Controller struct {
|
||||
}
|
||||
|
||||
func (c *Controller) Index() {
|
||||
c.View.Display("layout.html")
|
||||
}
|
||||
|
||||
// 不符合规范,不会被自动注册
|
||||
func (c *Controller) Test(value interface{}) {
|
||||
c.View.Assign("name", "john")
|
||||
c.View.Assign("mainTpl", "main/main2.html")
|
||||
c.View.Display("layout.html")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user