Is it possible to get all post variables in ExpressionEngine, like you could in CodeIgniter?

白昼怎懂夜的黑 提交于 2019-12-04 07:50:17
Jewel

Try native

$this->input->post(NULL, TRUE); // returns all POST items with XSS filter 
$this->input->post(); // returns all POST items without XSS filter

Ref: https://www.codeigniter.com/user_guide/libraries/input.html

Ok, the way to get results similar to CI within EE for all elements of a POST, while still leveraging the security features of EE is the following:

foreach($_POST as $key => $value){
     $data[$key] = $this->EE->input->post($key);
}

Since you can access POST vars by name, looping through them in $_POST, then explicitly calling each will yield the desired result.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!