code_junkie

CodeIgniter form validation - Get the result as “array” instead of “string”

Nov 13th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. $result = $this->form_validation->run();
  2.  
  3. Array
  4. {
  5. 'user_name' => 'user name is required',
  6. 'password' => 'passord is required'
  7. }
  8.  
  9. $this->form_validation->required($user_name);
  10. $this->form_validation->required($password);
  11.  
  12. class MY_Form_validation extends CI_Form_validation
  13. {
  14. public function getErrorsArray()
  15. {
  16. return $this->_error_array;
  17. }
  18. }
Add Comment
Please, Sign In to add comment