FormValidator Class Reference
[Form_validation]

Class to represent a form validation check. More...

Inheritance diagram for FormValidator:

FormValidatorArray FormValidatorArrayCustom FormValidatorCaptcha FormValidatorCustom FormValidatorInSet FormValidatorLength FormValidatorLocale FormValidatorPost FormValidatorRegExp

List of all members.

Public Member Functions

 FormValidator (&$form, $field, $type, $message)
 getField ()
 getMessage ()
 isEmptyAndOptional ()
 isValid ()

Public Attributes

 $field
 $form
 $message
 $type


Detailed Description

Class to represent a form validation check.

Definition at line 36 of file FormValidator.inc.php.


Member Function Documentation

FormValidator.FormValidator ( &$  form,
field,
type,
message 
)

Constructor.

Parameters:
$form Form the associated form
$field string the name of the associated field
$type string the type of check, either "required" or "optional"
$message string the error message for validation failures (i18n key)

Definition at line 57 of file FormValidator.inc.php.

References $field, $form, $message, and $type.

FormValidator.getField (  ) 

Get the field associated with the check.

Returns:
string

Reimplemented in FormValidatorLocale.

Definition at line 85 of file FormValidator.inc.php.

FormValidator.getMessage (  ) 

Get the error message associated with a failed validation check.

Returns:
string

Reimplemented in FormValidatorLocale.

Definition at line 93 of file FormValidator.inc.php.

References Locale.translate().

FormValidator.isEmptyAndOptional (  ) 

Check if field value is empty and optional.

Returns:
boolean

Reimplemented in FormValidatorLocale.

Definition at line 77 of file FormValidator.inc.php.

Referenced by FormValidatorRegExp.isValid(), FormValidatorLength.isValid(), FormValidatorInSet.isValid(), and FormValidatorCustom.isValid().

FormValidator.isValid (  ) 

Check if field value is valid. Default check is that field is either optional or not empty.

Returns:
boolean

Reimplemented in FormValidatorArray, FormValidatorArrayCustom, FormValidatorCaptcha, FormValidatorCustom, FormValidatorInSet, FormValidatorLength, FormValidatorLocale, FormValidatorPost, and FormValidatorRegExp.

Definition at line 69 of file FormValidator.inc.php.


Member Data Documentation

FormValidator.$field

FormValidator.$form

FormValidator.$message

FormValidator.$type


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

Generated on Mon Jul 14 10:55:42 2008 for Open Journal Systems by  doxygen 1.5.6