post参数
![]()
提交的时候出现500错误 提示:variable type error:array
解决方法
1 2 3 4
| $this->request->post('option')
$this->request->post('option/a')
|
/x 来源
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| if (is_array($name)) { $this->param = []; return $this->post = array_merge($this->post, $name); } return $this->input($this->post, $name, $default, $filter);
if (strpos($name, '/')) { list($name, $type) = explode('/', $name); } else { $type = 's'; }
if (isset($type) && $data !== $default) { $this->typeCast($data, $type); }
|
支持类型
/a 数组
/d 数字
/f 浮点
/b 布尔
/s 字符