public __construct ( array $rules = [] ) : void | ||
$rules | array | |
Результат | void |
public function __construct($rules = array())
{
$this->CI =& get_instance();
// applies delimiters set in config file.
if (isset($rules['error_prefix'])) {
$this->_error_prefix = $rules['error_prefix'];
unset($rules['error_prefix']);
}
if (isset($rules['error_suffix'])) {
$this->_error_suffix = $rules['error_suffix'];
unset($rules['error_suffix']);
}
// Validation rules can be stored in a config file.
$this->_config_rules = $rules;
// Automatically load the form helper
$this->CI->load->helper('form');
log_message('info', 'Form Validation Class Initialized');
}
function __construct($config = array()) { parent::__construct($config); parent::set_message('numeric_positive', 'The {field} field must contain a decimal greater or equal than 0.'); parent::set_message('image_base64', 'The {field} field must be a image in base64 format.'); parent::set_message('valid_base64', 'The {field} field must be base64 data.'); }