CodeIgniter Forums
validation for values in array - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: validation for values in array (/thread-68095.html)



validation for values in array - neuron - 05-24-2017

Hi, 

I am building API with CI v3. 
REST library automatically parses $_POST variable and puts contents in another variable.

I want form_validation library to validate the data I provide not posted ones.


RE: validation for values in array - dave friend - 05-24-2017

Easy. For example:

PHP Code:
$data = array(
 
       'username' => 'johndoe',
 
       'password' => 'mypassword',
 
       'passconf' => 'mypassword'
);

$this->form_validation->set_data($data); 

Documented here


RE: validation for values in array - neuron - 05-24-2017

thank you very much!