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

Class: Field

Source Location: /FormLib/Field.php

Class Overview


Base class used to derive other types of HTML fields.


Author(s):

  • Randy L. Pearson

Version:

  • 0.4

Variables

Methods


Child classes:

CheckboxField
Your basic checkbox HTML widget.
HiddenField
Object oriented wrapper around a hidden HTML text field.
Listbox
An object-oriented wrapper around an HTML listbox.
TextField
Object oriented wrapper around an HTML text input field.

Class Details

[line 19]
Base class used to derive other types of HTML fields.

This version adds the optional 'style' property that can be used to customize the appearance of the field.




Tags:

abstract:  
author:  Randy L. Pearson
version:  0.4


[ Top ]


Class Variables

$properties =

[line 21]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 35]

Field __construct( string $name, string $label, [string $value = ""], [Validator $validator = false], [PropertyHolder $style = false])

Constructor

Initializes a Field object.




Tags:

access:  public


Overridden in child classes as:

CheckboxField::__construct()
HiddenField::__construct()
Constructor
Listbox::__construct()
Constructor.
TextField::__construct()
Constructor
PasswordField::__construct()
Constructor Initializes a PasswordField object.

Parameters:

string   $name   Name assigned to the field.
string   $label   Label (e.g. text) assigned to the field.
string   $value   Value assigned to the field.
Validator   $validator   Object that can check the field's data for validity
PropertyHolder   $style   Additional style hinting information.

[ Top ]

method display [line 90]

void display( PropertyHolder $formStyle)

Function to render the field as HTML.

This function assumes forms are laid out in a 2 column table. It displays the field's label, then calls the abstract displayField() function.




Tags:

access:  public


Overridden in child classes as:

HiddenField::display()
Override the display function since we don't want a label.

Parameters:

PropertyHolder   $formStyle   Style hints from the containing form.

[ Top ]

method displayField [line 107]

void displayField( $formStyle)

Renders the field as HTML. Must be overridden in child classes.



Tags:

abstract:  
access:  protected


Overridden in child classes as:

CheckboxField::displayField()
HiddenField::displayField()
Listbox::displayField()
Renders the list box as HTML.
TextField::displayField()
Renders the label and text field assuming a 2 column table.

Parameters:

   $formStyle  

[ Top ]

method isValid [line 118]

boolean isValid( )

Checks to see if the data entered into a field is valid.



Tags:

return:  true if valid (or does not have a validator object)
access:  public
see:  Validator::isValid()
see:  Validator


[ Top ]

method __get [line 65]

void __get( string $name)

Property accessor.



Tags:

access:  public


Parameters:

string   $name   Name of the property to return.

[ Top ]

method __set [line 76]

void __set( string $name, any $value)

Property mutator.



Tags:

access:  public


Parameters:

string   $name   Name of the property to change.
any   $value   Value to assign to the property.

[ Top ]


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