Commit 27896c57 authored by yecrane's avatar yecrane

Update controller.go

form获取相同名字的对象数组值
parent 67695fac
......@@ -241,6 +241,18 @@ func (c *Controller) GetString(key string) string {
return c.Input().Get(key)
}
func (c *Controller) GetStrings(key string) []string {
r := c.Ctx.Request;
if r.Form == nil {
return []string{}
}
vs := r.Form[key]
if len(vs) > 0 {
return vs
}
return []string{}
}
func (c *Controller) GetInt(key string) (int64, error) {
return strconv.ParseInt(c.Input().Get(key), 10, 64)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment