1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-11 23:31:03 +00:00

beego: modify the filter sequence

This commit is contained in:
astaxie
2014-06-10 11:02:41 +08:00
parent 2570f075d9
commit f7b01aab13
3 changed files with 26 additions and 18 deletions

View File

@ -82,7 +82,7 @@ type ControllerInterface interface {
Render() error
XsrfToken() string
CheckXsrfCookie() bool
HandlerFunc(fn string)
HandlerFunc(fn string) bool
URLMapping()
}
@ -147,11 +147,12 @@ func (c *Controller) Options() {
}
// call function fn
func (c *Controller) HandlerFunc(fnname string) {
func (c *Controller) HandlerFunc(fnname string) bool {
if v, ok := c.methodMapping[fnname]; ok {
v()
return true
} else {
Error("call funcname not exist in the methodMapping: " + fnname)
return false
}
}