mirror of
https://github.com/astaxie/beego.git
synced 2025-07-12 10:01:02 +00:00
fix #18
func (this *MainController) Get() { this.GoToFunc("Test") } func (this *MainController) Test() { this.Ctx.WriteString("testtest") }
This commit is contained in:
@ -33,6 +33,7 @@ type Controller struct {
|
||||
Layout string
|
||||
TplExt string
|
||||
_xsrf_token string
|
||||
gotofunc string
|
||||
CruSession session.SessionStore
|
||||
}
|
||||
|
||||
@ -376,3 +377,10 @@ func (c *Controller) XsrfFormHtml() string {
|
||||
return "<input type=\"hidden\" name=\"_xsrf\" value=\"" +
|
||||
c._xsrf_token + "\"/>"
|
||||
}
|
||||
|
||||
func (c *Controller) GoToFunc(funcname string) {
|
||||
if funcname[0] < 65 || funcname[0] > 90 {
|
||||
panic("GoToFunc should exported function")
|
||||
}
|
||||
c.gotofunc = funcname
|
||||
}
|
||||
|
Reference in New Issue
Block a user