beego手册中这段:
数据绑定
支持从用户请求中直接数据bind到指定的对象,例如请求地址如下
?id=123&isok=true&ft=1.2&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=astaxievar id int ctx.Input.Bind(&id, "id") //id ==123 var isok bool ctx.Input.Bind(&isok, "isok") //isok ==true var ft float64 ctx.Input.Bind(&ft, "ft") //ft ==1.2 ol := make([]int, 0, 2) ctx.Input.Bind(&ol, "ol") //ol ==[1 2]
请问ol[0]=1&ol[1]=2这样的效果是如何产生的啊??ajax吗?能否给个例子?找了不少地方似乎都没谈到。
数据绑定
支持从用户请求中直接数据bind到指定的对象,例如请求地址如下
?id=123&isok=true&ft=1.2&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=astaxievar id int ctx.Input.Bind(&id, "id") //id ==123 var isok bool ctx.Input.Bind(&isok, "isok") //isok ==true var ft float64 ctx.Input.Bind(&ft, "ft") //ft ==1.2 ol := make([]int, 0, 2) ctx.Input.Bind(&ol, "ol") //ol ==[1 2]
请问ol[0]=1&ol[1]=2这样的效果是如何产生的啊??ajax吗?能否给个例子?找了不少地方似乎都没谈到。