Static Public Member Functions | |
| static | validate_url ($text, $control, $form, $warning=null, $schemes=array( 'http', 'https')) |
| static | validate_email ($text, $control, $form, $warning=null) |
| static | validate_required ($value, $control, $form, $warning=null) |
| static | validate_username ($value, $control, $form, $allowed_name=null, $warning=null) |
| static | validate_same ($value, $control, $form, $matcher, $warning=null) |
| static | validate_regex ($value, $control, $container, $regex, $warning=null) |
| static | validate_range ($value, $control, $container, $min, $max, $warning=null) |
FormValidators Class
Extend this class to supply your own validators, by default we supply most common
Definition at line 777 of file formui.php.
| static FormValidators::validate_email | ( | $ | text, | |
| $ | control, | |||
| $ | form, | |||
| $ | warning = null | |||
| ) | [static] |
A validation function that returns an error if the value passed in is not a valid Email Address, as per RFC2822 and RFC2821.
| string | $text A string to test if it is a valid Email Address | |
| FormControl | $control The control that defines the value | |
| FormContainer | $form The container that holds the control | |
| string | $warning An optional error message |
Definition at line 821 of file formui.php.
| static FormValidators::validate_range | ( | $ | value, | |
| $ | control, | |||
| $ | container, | |||
| $ | min, | |||
| $ | max, | |||
| $ | warning = null | |||
| ) | [static] |
A validation function that returns an error if the value passed is not within a specified range
| string | $value A value to test if it is empty | |
| FormControl | $control The control that defines the value | |
| FormContainer | $container The container that holds the control | |
| float | $min The minimum value, inclusive | |
| float | $max The maximum value, inclusive | |
| string | $warning An optional error message |
Definition at line 926 of file formui.php.
| static FormValidators::validate_regex | ( | $ | value, | |
| $ | control, | |||
| $ | container, | |||
| $ | regex, | |||
| $ | warning = null | |||
| ) | [static] |
A validation function that returns an error if the value passed does not match the regex specified.
| string | $value A value to test if it is empty | |
| FormControl | $control The control that defines the value | |
| FormContainer | $container The container that holds the control | |
| string | $regex The regular expression to test against | |
| string | $warning An optional error message |
Definition at line 902 of file formui.php.
| static FormValidators::validate_required | ( | $ | value, | |
| $ | control, | |||
| $ | form, | |||
| $ | warning = null | |||
| ) | [static] |
A validation function that returns an error if the value passed in is not set.
| string | $text A value to test if it is empty | |
| FormControl | $control The control that defines the value | |
| FormContainer | $form The container that holds the control | |
| string | $warning An optional error message |
Definition at line 841 of file formui.php.
| static FormValidators::validate_same | ( | $ | value, | |
| $ | control, | |||
| $ | form, | |||
| $ | matcher, | |||
| $ | warning = null | |||
| ) | [static] |
A validation function that returns an error if the passed control values do not match
| string | $text A value to test for similarity | |
| FormControl | $control The control that defines the value | |
| FormContainer | $form The container that holds the control | |
| FormControl | $matcher The control which should have a matching value | |
| string | $warning An optional error message |
Definition at line 883 of file formui.php.
| static FormValidators::validate_url | ( | $ | text, | |
| $ | control, | |||
| $ | form, | |||
| $ | warning = null, |
|||
| $ | schemes = array( 'http', 'https' ) | |||
| ) | [static] |
A validation function that returns an error if the value passed in is not a valid URL.
| string | $text A string to test if it is a valid URL | |
| FormControl | $control The control that defines the value | |
| FormContainer | $form The container that holds the control | |
| string | $warning An optional error message |
Definition at line 789 of file formui.php.
| static FormValidators::validate_username | ( | $ | value, | |
| $ | control, | |||
| $ | form, | |||
| $ | allowed_name = null, |
|||
| $ | warning = null | |||
| ) | [static] |
A validation function that returns an error if the the passed username is unavailable
| string | $text A value to test as username | |
| FormControl | $control The control that defines the value | |
| FormContainer | $form The container that holds the control | |
| string | $allowed_name An optional name which overrides the check and is always allowed | |
| string | $warning An optional error message |
Definition at line 860 of file formui.php.
1.7.1