1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 20:30:39 +00:00

Merge pull request #2085 from danielscottt/reset-params

adds ability to reset params after a filter runs
This commit is contained in:
astaxie
2016-08-09 07:24:08 +08:00
committed by GitHub
4 changed files with 117 additions and 14 deletions

View File

@ -301,6 +301,14 @@ func (input *BeegoInput) SetParam(key, val string) {
input.pnames = append(input.pnames, key)
}
// ResetParams clears any of the input's Params
// This function is used to clear parameters so they may be reset between filter
// passes.
func (input *BeegoInput) ResetParams() {
input.pnames = input.pnames[:0]
input.pvalues = input.pvalues[:0]
}
// Query returns input data item string by a given string.
func (input *BeegoInput) Query(key string) string {
if val := input.Param(key); val != "" {