Definition at line 17 of file Validation.php.
◆ __construct()
Validation::__construct |
( |
|
$func_name | ) |
|
#- Initialise a new validation.
- Parameters
-
string | $func_name | The javascript function name to call onsubmit of the form |
Definition at line 40 of file Validation.php.
◆ AddRule()
Validation::AddRule |
( |
|
$fieldname, |
|
|
|
$error_message, |
|
|
|
$function_name |
|
) |
| |
Adds a validation rule for a specific field upon submission of the form. You must call RenderRules below RenderFields when outputing the page
- Parameters
-
string | $fieldname | The name of the field. |
string | $error_message | The message to display on unsuccessful validation. |
string | $function_name | The function to call to validate the field |
Definition at line 53 of file Validation.php.
◆ not_empty()
Validation::not_empty |
( |
|
$field_string | ) |
|
Checks if a string is empty
- Parameters
-
string | $field_string | The field value that is being checked. |
- Returns
- boolean True if the string is not empty.
Definition at line 129 of file Validation.php.
◆ positive_dollars()
Validation::positive_dollars |
( |
|
$field_string | ) |
|
Check that the given string is a positive dollar amount. Use not_empty first if string is required.
- Parameters
-
string | $field_string | The amount to be checked. |
- Returns
- boolean Returns true if the given string is a positive dollar amount.
Definition at line 150 of file Validation.php.
◆ positive_integer()
Validation::positive_integer |
( |
|
$field_string | ) |
|
Check that the given string is a positive integer. Use not_empty first if string is required.
- Parameters
-
string | $field_string | The amount to be checked. |
- Returns
- boolean Returns true if the given string is a positive integer.
Definition at line 167 of file Validation.php.
◆ RenderJavascript()
Validation::RenderJavascript |
( |
|
$prefix = "" | ) |
|
Returns the javascript for form validation using the rules.
- Parameters
-
string | $onsubmit | The name of the function called on submission of the form. |
string | $prefix | Optional prefix for form fields. |
- Returns
- string HTML/Javascript for form validation.
Definition at line 64 of file Validation.php.
◆ selected()
Validation::selected |
( |
|
$field_string | ) |
|
Checks that a string is not empty or zero
- Parameters
-
string | $select_string | The select value that is being checked. |
- Returns
- boolean True if the string is not empty or equal to 0.
Definition at line 139 of file Validation.php.
◆ valid_date_format()
Validation::valid_date_format |
( |
|
$field_string | ) |
|
Check that the given string matches the user's date format. Use not_empty first if string is required.
- Parameters
-
string | $field_string | The string to be checked. |
- Returns
- boolean Returns true if the given string matches the user's date format from session.
Definition at line 193 of file Validation.php.
◆ valid_email_format()
Validation::valid_email_format |
( |
|
$field_string | ) |
|
Check that the given string is a valid email address. Use not_empty first if string is required.
- Parameters
-
string | $field_string | The string to be checked. |
- Returns
- boolean Returns true if the given string is a valid email address.
Definition at line 179 of file Validation.php.
◆ Validate()
Validation::Validate |
( |
|
$object | ) |
|
Validates the form according to it's rules.
- Parameters
-
object | $object | The data object that requires form validation. |
- Returns
- boolean True if the validation succeeded.
Definition at line 99 of file Validation.php.
◆ $func_name
Validation::$func_name = "" |
◆ $rules
Validation::$rules = array() |
The documentation for this class was generated from the following file: