$this->form_validation->set_data($this->Data) not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: $this->form_validation->set_data($this->Data) not working (/showthread.php?tid=66128) |
$this->form_validation->set_data($this->Data) not working - Douglas Fernando - 09-09-2016 Good night here staff Brazil, I'm trying to validate an e-mail and password field, that future will come from the global $ _POST, but I'm porenquanto testing the class I am creating. Even I already sending a completed array with the data to validate, validation returns me errors that do not exist. Follows the code of my MODEL (m_login.php): PHP Code: <?php Follows the code of my CONTROLLER (login.php): PHP Code: /** This is what my CONTROLLER (login.php) is displaying on the screen, I realize that even through e-mail and password validation says the fields are empty (the screen print is attached to this post). RE: $this->form_validation->set_data($this->Data) not working - Douglas Fernando - 09-10-2016 Goodnight everyone, when I try to validate some fields that are NOT within $ _POST, I use the method $this->form_validation_>set_data($data); But even with my filled field, when I validate a field "required" validation library says the fields are empty. After much headbanging, I found a validation library (Validation.php), github, which solved my problem. Follow the link :https://github.com/lumoz/codeigniter-form-validation. PS: This could be noted to be corrected in future updates. RE: $this->form_validation->set_data($this->Data) not working - PaulD - 09-10-2016 Interested in what you said, I did a quick test using this PHP Code: $data = array( So am not sure why your validation is not working, as it seems to be working fine. Other tests with valid_email etc. all behaved as expected. PS Thought I should mention this is with CI 3.1.0 |