reset_validation() public method

Prevents subsequent validation routines from being affected by the results of any previous validation routine due to the CI singleton.
public reset_validation ( ) : CI_Form_validation
return CI_Form_validation
Exemplo n.º 1
0
 /**
  * Reset validation vars
  *
  * Prevents subsequent validation routines from being affected by the results
  * of any previous validation routine due to the CI singleton.
  *
  * This method can be removed when compatibility with CI 2 is no longer needed,
  * as the method already exists in CI 3.
  *
  * @return $this
  */
 public function reset_validation()
 {
     // Just in case the parent method changes at some point in the future.
     if (substr(CI_VERSION, 0, 1) != '2') {
         return parent::reset_validation();
     }
     $this->_field_data = array();
     $this->_config_rules = array();
     $this->_error_array = array();
     $this->_error_messages = array();
     $this->error_string = '';
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Reset validation vars
  *
  * Prevents subsequent validation routines from being affected by the
  * results of any previous validation routine due to the CI singleton.
  *
  * @return	CI_Form_validation
  */
 public function reset_validation()
 {
     $this->error_string = '';
     $this->request_method = '';
     return parent::reset_validation();
 }