Provides form abstraction, integrating retrieval and validation into one package.
Methods
Construct new form
__construct(string $action, string $method)
Parameters
$action
string
$method
string
Returns a field with $name.
__get(string $name) : \WebLab_Form_Field
Parameters
$name
string
Returns
Returns whether a field is set.
__isset(string $name) : boolean
Parameters
$name
string
Returns
boolean
Add a field to the form
add(\WebLab_Form_Field $field)
Returns a field with $name
get(string $name) : \WebLab_Form_Field | array
Parameters
$name
string
Returns
Return the action that this form is configured with.
getAction() : string
Retrieve validation errors.
getErrors() : \multitype:
Get a list of the fields.
getFields() : array
Return method being used.
getMethod() : string
Retrieve the correct response set
getResponse() : array
Get all fields their values.
getResults() : array
Get the value of a field
getValue(\unknown_type $field) : string
Parameters
$field
\unknown_type
Exceptions
Returns
string
Get all fields their values.
getValues() : array
Determine if we are dealing with a postback.
isPostback() : boolean
Determine if all fields are filled out correctly.
isValid() : boolean
Set the action to be used by this form
setAction(string $action) : \WebLab_Form
Parameters
$action
string
Exceptions
Returns
Set method form is going to use.
setMethod(string $method) : \WebLab_Form
Parameters
$method
string
Exceptions
Returns
Set value for a fields.
setValues(array $obj) : \WebLab_Form
Parameters
$obj
array
Returns
Update fields to correspond with posted value.
update()
Declare fields used by this form.
_setupFields()
Generate postback element
_setupPostback()
Declare validation rules for this form.
_setupValidation()
Properties
Constants
Constant for GET method
GET : string
Constant for POST method
POST : string