Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
FormValidatorLength Class Reference
Inheritance diagram for FormValidatorLength:

Public Member Functions

 FormValidatorLength (&$form, $field, $type, $message, $comparator, $length)
 isValid ()
- Public Member Functions inherited from FormValidator
 FormValidator (&$form, $field, $type, $message, $validator=null)
 getField ()
 getFieldValue ()
getForm ()
 getMessage ()
 getType ()
getValidator ()
 isEmptyAndOptional ()
 isValid ()

Public Attributes

- Public Attributes inherited from FormValidator

Detailed Description

Form validation check that checks if a field's length meets certain requirements.

Definition at line 18 of file

Member Function Documentation

FormValidatorLength::FormValidatorLength ( $form,


$formForm the associated form
$fieldstring the name of the associated field
$typestring the type of check, either "required" or "optional"
$messagestring the error message for validation failures (i18n key)

Definition at line 41 of file

References FormValidator\getFieldValue(), FormValidator\isEmptyAndOptional(), and String\strlen().

FormValidatorLength::isValid ( )
See Also
FormValidator::isValid() Value is valid if it is empty and optional or meets the specified length requirements.

Definition at line 56 of file

References $_length.

Member Data Documentation

string FormValidatorLength::$_comparator

comparator to use (== | != | < | > | <= | >= )

Definition at line 24 of file

int FormValidatorLength::$_length

length to compare with

Definition at line 30 of file

Referenced by isValid().

The documentation for this class was generated from the following file: