Framework
3.9
|
The ValidationEngine takes an array of validator objects in its constructor, and is then able to generate both client- and server-side validation for HTML forms. More...
Public Member Functions | |
ValidationEngine () | |
Create a new ValidationEngine. More... | |
writeScript () | |
Output the client-side form validation function, based on all the validators that have been added. More... | |
add () | |
Add a validator. More... | |
getValidator ($field, $class) | |
Get the specified validator by field and class. More... | |
getValidators ($field) | |
Get the validators attached to a specific field. More... | |
validate () | |
Perform server-side validation of the posted form values. More... | |
isRequired ($field) | |
Checks to see whether the specified field has a RequiredValidator attached to it. More... | |
hasRequiredFields () | |
Checks to see whether any fields have been marked as required. More... | |
Public Attributes | |
$validators = array() | |
The array of validators making up this validation engine. More... | |
$msg = "" | |
Validation error messages accumulator;. More... | |
$id = "" | |
The ID of this validator. More... | |
$generateScript = true | |
Specifies whether to generate client-side validation script. More... | |
The ValidationEngine takes an array of validator objects in its constructor, and is then able to generate both client- and server-side validation for HTML forms.
Definition at line 1557 of file validation.inc.
ValidationEngine::add | ( | ) |
Add a validator.
Definition at line 1606 of file validation.inc.
ValidationEngine::getValidator | ( | $field, | |
$class | |||
) |
Get the specified validator by field and class.
unknown_type | $field | the validator's field |
unknown_type | $class | the validator's class |
Definition at line 1619 of file validation.inc.
ValidationEngine::getValidators | ( | $field | ) |
Get the validators attached to a specific field.
$field | the field |
Definition at line 1636 of file validation.inc.
ValidationEngine::hasRequiredFields | ( | ) |
Checks to see whether any fields have been marked as required.
Definition at line 1692 of file validation.inc.
ValidationEngine::isRequired | ( | $field | ) |
Checks to see whether the specified field has a RequiredValidator attached to it.
$field | the field to check |
Definition at line 1678 of file validation.inc.
ValidationEngine::validate | ( | ) |
Perform server-side validation of the posted form values.
The msg field of the ValidationEngine accumulates all the error messages raised by the individual validators.
Definition at line 1655 of file validation.inc.
ValidationEngine::ValidationEngine | ( | ) |
Create a new ValidationEngine.
Definition at line 1567 of file validation.inc.
ValidationEngine::writeScript | ( | ) |
Output the client-side form validation function, based on all the validators that have been added.
Definition at line 1575 of file validation.inc.
ValidationEngine::$generateScript = true |
Specifies whether to generate client-side validation script.
Definition at line 1562 of file validation.inc.
ValidationEngine::$id = "" |
The ID of this validator.
Definition at line 1561 of file validation.inc.
ValidationEngine::$msg = "" |
Validation error messages accumulator;.
Definition at line 1560 of file validation.inc.
ValidationEngine::$validators = array() |
The array of validators making up this validation engine.
Definition at line 1559 of file validation.inc.