Updating from 1.6.3 to 2.1.0 - getting validated POST data |
[eluser]potion[/eluser]
I've been away from CI for a while, apologies if this is obvious. I'm updating a site from CI 1.6.3 to 2.1.0 Getting POST data using the old validation class used something like: Code: $my_form_field = $this->validation->my_form_field; With the replacement form_validation class is it sufficient to simply use: Code: $my_form_field = $this->input->post('my_form_field');
[eluser]dallen33[/eluser]
Should be okay, but you might want to read up on the guide: http://ellislab.com/codeigniter/user-gui...ation.html
[eluser]InsiteFX[/eluser]
Also check these ./application/config/config.php: Code: /*
[eluser]potion[/eluser]
[quote author="dallen33" date="1329072872"]Should be okay, but you might want to read up on the guide...[/quote] Surprisingly, the guide does not show an example of using the POST data. My assumption is that the method form_validation->run() reads and validates the POST data, and the method subsequently used to fetch the POST data is arbitrary. The old validation->run() also worked on the POST data, but using $this->validation->my_form_field validated the field again, and was deemed redundant. I think it's safe to use $this->input-post(my_form_field) without fear of the reworked 2.1.0 code being any less robust than it's predecessor. < : ) den |
Welcome Guest, Not a member yet? Register Sign In |