Welcome Guest, Not a member yet? Register   Sign In
Different way to work with Post Data

Hi folks,

I was asking myself if this would be possible



$postData = $this->input->post(array('test'=>$postdata['test']));


Because in the CI description you say I can work with every types such as array etc

You don't need to load the input library, it's autoloaded.

I don't think that will work anyway - I don't think you can directly set post values (correct me if I'm wrong, CI experts).

Finally - why not just try your code and see if it works?!

[eluser]Colin Williams[/eluser]
The documentation is extremely clear on how you work with posted arrays. I'm not even sure what you are trying to achieve with your code snippet.

The docs also say you don't need to load the Input class. I'm questioning whether you have read them closely enough.

[eluser]Colin Williams[/eluser]
Quote: I don’t think you can directly set post values (correct me if I’m wrong, CI experts)

You can. Like this:

$_POST['custom'] = 'value';

No need to over-think this stuff.

Theme © iAndrew 2016 - Forum software by © MyBB