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

Mike_K picture Mike_K · Jun 20, 2012 · Viewed 25k times · Source

In a controller in CI you could get all post variables by doing something like this:

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

In EE (built off of CI by the same people) the analogous syntax would be:

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

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

Is there some way of getting an array of all post data, using ExpressionEngine rather than the POST superglobal?

Thanks.

Answer

Jewel picture Jewel · Apr 9, 2015

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