1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-24 22:20:53 +00:00

GetStrings action as GetString

This commit is contained in:
asta.xie 2014-02-26 15:02:58 +08:00
parent 04a19685ed
commit d05270d2ec

View File

@ -308,11 +308,11 @@ func (c *Controller) GetString(key string) string {
// GetStrings returns the input string slice by key string.
// it's designed for multi-value input field such as checkbox(input[type=checkbox]), multi-selection.
func (c *Controller) GetStrings(key string) []string {
r := c.Ctx.Request
if r.Form == nil {
f := c.Input()
if f == nil {
return []string{}
}
vs := r.Form[key]
vs := f[key]
if len(vs) > 0 {
return vs
}