Public Member Functions | |
__construct ($rules=array()) | |
set_rules ($field, $label= '', $rules= '') | |
set_message ($lang, $val= '') | |
set_error_delimiters ($prefix= '< p >', $suffix= '</p >') | |
error ($field= '', $prefix= '', $suffix= '') | |
error_string ($prefix= '', $suffix= '') | |
run ($group= '') | |
set_value ($field= '', $default= '') | |
set_select ($field= '', $value= '', $default=FALSE) | |
set_radio ($field= '', $value= '', $default=FALSE) | |
set_checkbox ($field= '', $value= '', $default=FALSE) | |
required ($str) | |
regex_match ($str, $regex) | |
matches ($str, $field) | |
is_unique ($str, $field) | |
min_length ($str, $val) | |
max_length ($str, $val) | |
exact_length ($str, $val) | |
valid_email ($str) | |
valid_emails ($str) | |
valid_ip ($ip, $which= '') | |
alpha ($str) | |
alpha_numeric ($str) | |
alpha_dash ($str) | |
numeric ($str) | |
is_numeric ($str) | |
integer ($str) | |
decimal ($str) | |
greater_than ($str, $min) | |
less_than ($str, $max) | |
is_natural ($str) | |
is_natural_no_zero ($str) | |
valid_base64 ($str) | |
prep_for_form ($data= '') | |
prep_url ($str= '') | |
strip_image_tags ($str) | |
xss_clean ($str) | |
encode_php_tags ($str) | |
Protected Member Functions | |
_reduce_array ($array, $keys, $i=0) | |
_reset_post_array () | |
_execute ($row, $rules, $postdata=NULL, $cycles=0) | |
_translate_fieldname ($fieldname) | |
__construct | ( | $rules = array() ) |
Constructor
|
protected |
Executes the Validation routines
private
array | |
array | |
mixed | |
integer |
|
protected |
Traverse a multidimensional $_POST array index until the data is found
private
array | |
array | |
integer |
|
protected |
Re-populate the _POST array with our finalized and processed data
private
|
protected |
Translate a field name
private
string | the field name |
alpha | ( | $str) |
Alpha
public
string |
alpha_dash | ( | $str) |
Alpha-numeric with underscores and dashes
public
string |
alpha_numeric | ( | $str) |
Alpha-numeric
public
string |
decimal | ( | $str) |
Decimal number
public
string |
encode_php_tags | ( | $str) |
Convert PHP tags to entities
public
string |
error | ( | $field = '' , |
|
$prefix = '' , |
|||
$suffix = '' |
|||
) |
Get Error Message
Gets the error message associated with a particular field
public
string | the field name |
error_string | ( | $prefix = '' , |
|
$suffix = '' |
|||
) |
Error String
Returns the error messages as a string, wrapped in the error delimiters
public
string | |
string |
exact_length | ( | $str, | |
$val | |||
) |
Exact Length
public
string | |
value |
greater_than | ( | $str, | |
$min | |||
) |
Greather than
public
string |
integer | ( | $str) |
Integer
public
string |
is_natural | ( | $str) |
Is a Natural number (0,1,2,3, etc.)
public
string |
is_natural_no_zero | ( | $str) |
Is a Natural number, but not a zero (1,2,3, etc.)
public
string |
is_numeric | ( | $str) |
Is Numeric
public
string |
is_unique | ( | $str, | |
$field | |||
) |
Match one field to another
public
string | |
field |
less_than | ( | $str, | |
$max | |||
) |
Less than
public
string |
matches | ( | $str, | |
$field | |||
) |
Match one field to another
public
string | |
field |
max_length | ( | $str, | |
$val | |||
) |
Max Length
public
string | |
value |
min_length | ( | $str, | |
$val | |||
) |
Minimum Length
public
string | |
value |
numeric | ( | $str) |
Numeric
public
string |
prep_for_form | ( | $data = '' ) |
Prep data for form
This function allows HTML to be safely shown in a form. Special characters are converted.
public
string |
prep_url | ( | $str = '' ) |
Prep URL
public
string |
regex_match | ( | $str, | |
$regex | |||
) |
Performs a Regular Expression match test.
public
string | |
regex |
required | ( | $str) |
Required
public
string |
run | ( | $group = '' ) |
Run the Validator
This function does all the work.
public
set_checkbox | ( | $field = '' , |
|
$value = '' , |
|||
$default = FALSE |
|||
) |
Set Checkbox
Enables checkboxes to be set to the value the user selected in the event of an error
public
string | |
string |
set_error_delimiters | ( | $prefix = '<p>' , |
|
$suffix = '</p>' |
|||
) |
Set The Error Delimiter
Permits a prefix/suffix to be added to each error message
public
string | |
string |
set_message | ( | $lang, | |
$val = '' |
|||
) |
Set Error Message
Lets users set their own error messages on the fly. Note: The key name has to match the function name that it corresponds to.
public
string | |
string |
set_radio | ( | $field = '' , |
|
$value = '' , |
|||
$default = FALSE |
|||
) |
Set Radio
Enables radio buttons to be set to the value the user selected in the event of an error
public
string | |
string |
set_rules | ( | $field, | |
$label = '' , |
|||
$rules = '' |
|||
) |
Set Rules
This function takes an array of field names and validation rules as input, validates the info, and stores it
public
mixed | |
string |
set_select | ( | $field = '' , |
|
$value = '' , |
|||
$default = FALSE |
|||
) |
Set Select
Enables pull-down lists to be set to the value the user selected in the event of an error
public
string | |
string |
set_value | ( | $field = '' , |
|
$default = '' |
|||
) |
Get the value from a form
Permits you to repopulate a form field with the value it was submitted with, or, if that value doesn't exist, with the default
public
string | the field name |
string |
strip_image_tags | ( | $str) |
Strip Image Tags
public
string |
valid_base64 | ( | $str) |
Valid Base64
Tests a string for characters outside of the Base64 alphabet as defined by RFC 2045 http://www.faqs.org/rfcs/rfc2045
public
string |
valid_email | ( | $str) |
Valid Email
public
string |
valid_emails | ( | $str) |
Valid Emails
public
string |
valid_ip | ( | $ip, | |
$which = '' |
|||
) |
Validate IP Address
public
string | |
string | "ipv4" or "ipv6" to validate a specific ip format |
xss_clean | ( | $str) |
XSS Clean
public
string |