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

In the controller in CI, you can get all the post variables by doing something like this:

$data = $this->input->post();

In EE (built by CI by the same people), a similar syntax would be:

$data = $this->EE->input->post();

The only problem is that instead of an array with all the data, you get a boolean false.

Is there a way to get an array of all message data using ExpressionEngine and not POST superclasses?

Thank.

+5
source share
2 answers

Well, a way to get results similar to CI in EE for all POST elements while using the EE security features:

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

POST , $_POST, .

+6

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

: https://ellislab.com/codeigniter/user-guide/libraries/input.html

+14

All Articles