Property | Type | Description | |
---|---|---|---|
$validation_data | array | Custom data to validate |
Property | Type | Description | |
---|---|---|---|
$CI | object | Reference to the CodeIgniter instance | |
$_config_rules | array | Validation rules for the current form | |
$_error_array | array | Array of validation errors | |
$_error_messages | array | Array of custom error messages | |
$_error_prefix | string | Start tag for error wrapping | |
$_error_suffix | string | End tag for error wrapping | |
$_field_data | array | Validation data for the current form submission | |
$_safe_form_data | boolean | Whether the form data has been validated as safe | |
$error_string | string | Custom error message |
Method | Description | |
---|---|---|
__construct ( array $rules = [] ) : void | Initialize Form_Validation class | |
alpha ( $str ) : boolean | Alpha | |
alpha_dash ( $str ) : boolean | Alpha-numeric with underscores and dashes | |
alpha_numeric ( $str ) : boolean | Alpha-numeric | |
alpha_numeric_spaces ( $str ) : boolean | Alpha-numeric w/ spaces | |
decimal ( $str ) : boolean | Decimal number | |
differs ( $str, $field ) : boolean | Differs from another field | |
encode_php_tags ( $str ) : string | Convert PHP tags to entities | |
error ( string $field, string $prefix = '', string $suffix = '' ) : string | Get Error Message | |
error_array ( ) : array | Get Array of Error Messages | |
error_string ( $prefix = '', $suffix = '' ) : string | Error String | |
exact_length ( $str, $val ) : boolean | Exact Length | |
greater_than ( $str, $min ) : boolean | Greater than | |
greater_than_equal_to ( $str, $min ) : boolean | Equal to or Greater than | |
has_rule ( $field ) : boolean | Checks if the rule is present within the validator | |
in_list ( $value, $list ) : boolean | Value should be within an array of values | |
integer ( $str ) : boolean | Integer | |
is_natural ( $str ) : boolean | Is a Natural number (0,1,2,3, etc.) | |
is_natural_no_zero ( $str ) : boolean | Is a Natural number, but not a zero (1,2,3, etc.) | |
is_unique ( string $str, string $field ) : boolean | Is Unique | |
less_than ( $str, $max ) : boolean | Less than | |
less_than_equal_to ( $str, $max ) : boolean | Equal to or Less than | |
matches ( string $str, string $field ) : boolean | Match one field to another | |
max_length ( $str, $val ) : boolean | Max Length | |
min_length ( $str, $val ) : boolean | Minimum Length | |
numeric ( $str ) : boolean | Numeric | |
prep_for_form ( mixed $data ) : mixed | Prep data for form | |
prep_url ( $str = '' ) : string | Prep URL | |
regex_match ( $str, $regex ) : boolean | Performs a Regular Expression match test. | |
required ( $str ) : boolean | Required | |
reset_validation ( ) : CI_Form_validation | Reset validation vars | |
run ( string $group = '' ) : boolean | Run the Validator | |
set_checkbox ( $field = '', $value = '', $default = FALSE ) : string | Set Checkbox | |
set_data ( array $data ) : CI_Form_validation | By default, form validation uses the $_POST array to validate | |
set_error_delimiters ( $prefix = '<p>', $suffix = '</p>' ) : CI_Form_validation | Set The Error Delimiter | |
set_message ( $lang, $val = '' ) : CI_Form_validation | Set Error Message | |
set_radio ( $field = '', $value = '', $default = FALSE ) : string | Set Radio | |
set_rules ( mixed $field, string $label = '', mixed $rules = [], array $errors = [] ) : CI_Form_validation | Set Rules | |
set_select ( $field = '', $value = '', $default = FALSE ) : string | Set Select | |
set_value ( $field = '', $default = '' ) : string | Get the value from a form | |
strip_image_tags ( $str ) : string | Strip Image Tags | |
valid_base64 ( $str ) : boolean | Valid Base64 | |
valid_email ( $str ) : boolean | Valid Email | |
valid_emails ( $str ) : boolean | Valid Emails | |
valid_ip ( $ip, $which = '' ) : boolean | Validate IP Address | |
valid_url ( string $str ) : boolean | Valid URL | |
xss_clean ( $str ) : string | XSS Clean |
Method | Description | |
---|---|---|
_build_error_msg ( $line, $field = '', $param = '' ) : string | Build an error message using the field and param. | |
_execute ( $row, $rules, $postdata = NULL, $cycles ) : mixed | Executes the Validation routines | |
_get_error_message ( string $rule, string $field ) : string | Get the error message for the rule | |
_reduce_array ( $array, $keys, $i ) : mixed | Traverse a multidimensional $_POST array index until the data is found | |
_reset_post_array ( ) : void | Re-populate the _POST array with our finalized and processed data | |
_translate_fieldname ( $fieldname ) : string | Translate a field name |
public __construct ( array $rules = [] ) : void | ||
$rules | array | |
return | void |
protected _build_error_msg ( $line, $field = '', $param = '' ) : string | ||
return | string |
protected _reduce_array ( $array, $keys, $i ) : mixed | ||
return | mixed |
protected _reset_post_array ( ) : void | ||
return | void |
protected _translate_fieldname ( $fieldname ) : string | ||
return | string |
public alpha_dash ( $str ) : boolean | ||
return | boolean |
public alpha_numeric_spaces ( $str ) : boolean | ||
return | boolean |
public encode_php_tags ( $str ) : string | ||
return | string |
public error_array ( ) : array | ||
return | array |
public error_string ( $prefix = '', $suffix = '' ) : string | ||
return | string |
public exact_length ( $str, $val ) : boolean | ||
return | boolean |
public greater_than ( $str, $min ) : boolean | ||
return | boolean |
public greater_than_equal_to ( $str, $min ) : boolean | ||
return | boolean |
public is_natural ( $str ) : boolean | ||
return | boolean |
public is_natural_no_zero ( $str ) : boolean | ||
return | boolean |
public less_than_equal_to ( $str, $max ) : boolean | ||
return | boolean |
public prep_for_form ( mixed $data ) : mixed | ||
$data | mixed | Input data |
return | mixed |
public regex_match ( $str, $regex ) : boolean | ||
return | boolean |
public reset_validation ( ) : CI_Form_validation | ||
return | CI_Form_validation |
public set_checkbox ( $field = '', $value = '', $default = FALSE ) : string | ||
return | string |
public set_error_delimiters ( $prefix = '<p>', $suffix = '</p>' ) : CI_Form_validation | ||
return | CI_Form_validation |
public set_message ( $lang, $val = '' ) : CI_Form_validation | ||
return | CI_Form_validation |
public set_select ( $field = '', $value = '', $default = FALSE ) : string | ||
return | string |
public strip_image_tags ( $str ) : string | ||
return | string |
public valid_base64 ( $str ) : boolean | ||
return | boolean |
protected array $_config_rules | ||
return | array |
protected array $_error_array | ||
return | array |
protected array $_error_messages | ||
return | array |
protected string $_error_prefix | ||
return | string |
protected string $_error_suffix | ||
return | string |
protected array $_field_data | ||
return | array |
protected bool $_safe_form_data | ||
return | boolean |
protected string $error_string | ||
return | string |
public array $validation_data | ||
return | array |