1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-06 04:20:19 +00:00

Changes to handle multi filters on execution pt

This commit is contained in:
Bill Davis
2014-10-07 16:35:30 -04:00
parent aae89576c6
commit b6f789c497
4 changed files with 211 additions and 8 deletions

View File

@ -318,9 +318,10 @@ func DelStaticPath(url string) *App {
// InsertFilter adds a FilterFunc with pattern condition and action constant.
// The pos means action constant including
// beego.BeforeRouter, beego.AfterStatic, beego.BeforeExec, beego.AfterExec and beego.FinishRouter.
func InsertFilter(pattern string, pos int, filter FilterFunc) *App {
BeeApp.Handlers.InsertFilter(pattern, pos, filter)
// beego.BeforeStatic, beego.BeforeRouter, beego.BeforeExec, beego.AfterExec and beego.FinishRouter.
// The bool params is for setting the returnOnOutput value (false allows multiple filters to execute)
func InsertFilter(pattern string, pos int, filter FilterFunc, params ...bool) *App {
BeeApp.Handlers.InsertFilter(pattern, pos, filter, params...)
return BeeApp
}