1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 13:50:20 +00:00

add func InsertFilter(pattern string, pos int, filter FilterFunc) *App to replace AddFilter

pos can be const:
    BeforeRouter = iota
    AfterStatic
    BeforeExec
    AfterExec
    FinishRouter
This commit is contained in:
knightmare
2013-11-25 15:59:40 +08:00
parent a0dff9148a
commit 47fc32ba47
3 changed files with 56 additions and 15 deletions

5
app.go
View File

@ -96,6 +96,11 @@ func (app *App) Filter(pattern, action string, filter FilterFunc) *App {
return app
}
func (app *App) InsertFilter(pattern string, pos int, filter FilterFunc) *App {
app.Handlers.InsertFilter(pattern, pos, filter)
return app
}
func (app *App) SetViewsPath(path string) *App {
ViewsPath = path
return app