mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 11:00:55 +00:00
GetStrings action as GetString
This commit is contained in:
parent
f7430a2ce1
commit
57afd3d979
@ -308,11 +308,11 @@ func (c *Controller) GetString(key string) string {
|
|||||||
// GetStrings returns the input string slice by key 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.
|
// it's designed for multi-value input field such as checkbox(input[type=checkbox]), multi-selection.
|
||||||
func (c *Controller) GetStrings(key string) []string {
|
func (c *Controller) GetStrings(key string) []string {
|
||||||
r := c.Ctx.Request
|
f := c.Input()
|
||||||
if r.Form == nil {
|
if f == nil {
|
||||||
return []string{}
|
return []string{}
|
||||||
}
|
}
|
||||||
vs := r.Form[key]
|
vs := f[key]
|
||||||
if len(vs) > 0 {
|
if len(vs) > 0 {
|
||||||
return vs
|
return vs
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user