FormLib
[ class tree: FormLib ] [ index: FormLib ] [ all elements ]

Class: DefaultValueValidator

Source Location: /FormLib/DefaultValueValidator.php

Class Overview

Validator
   |
   --DefaultValueValidator

Supplies a default field value if the user leaves the field empty.


Author(s):

  • Randy

Version:

  • 0.2

Methods


Inherited Methods

Class: Validator

Validator::errorMessage()
Get an error message that can be shown to the user.
Validator::isValid()
Validates the value the user entered into a field.

Class Details

[line 19]
Supplies a default field value if the user leaves the field empty.



Tags:

author:  Randy
version:  0.2


[ Top ]


Class Methods


constructor __construct [line 31]

DefaultValueValidator __construct( any $defaultValue)

Initializes a DefaultValueValidator object.



Tags:

access:  public


Parameters:

any   $defaultValue   The field's default value.

[ Top ]

method errorMessage [line 50]

void errorMessage( $field)

This validator never generates an error.



Tags:

access:  public


Overrides Validator::errorMessage() (Get an error message that can be shown to the user.)

Parameters:

   $field  

[ Top ]

method isValid [line 40]

void isValid( &$field)

Checks the value the user entered and if empty/missing, sets the field with the default value supplied to the constructor.



Tags:

access:  public


Overrides Validator::isValid() (Validates the value the user entered into a field.)

Parameters:

   &$field  

[ Top ]


Documentation generated on Wed, 15 Nov 2006 08:48:03 -0600 by phpDocumentor 1.3.1