dmBridge PHP API
DMAbstractForm Class Reference
Inheritance diagram for DMAbstractForm:

Public Member Functions

Static Public Member Functions

Data Fields

Protected Member Functions

Protected Attributes


Detailed Description

A base form class from which all forms should inherit.

The form creation & submission process is as follows:

  1. Present form by calling individual form elements' getHTMLTag() methods
  2. init() is called
  3. loadFromDataStore() is called
  4. User submits form via HTTP POST
  5. The form is saved to the session
  6. validate() is called
  7. If the form validates, doAction() is called; otherwise validate() will throw a DMIllegalArgumentException
  8. If doAction() returns, the form is erased from the session
Author:
Alex Dolski <alex.dolski@unlv.edu> http://www.opensource.org/licenses/mit-license.php

Definition at line 30 of file DMAbstractForm.php.


Member Function Documentation

DMAbstractForm::checkRadioWithNameAndValue ( name,
value 
)
Parameters:
stringname
mixedvalue
Since:
2.0

Definition at line 192 of file DMAbstractForm.php.

Referenced by DMCPEditCollectionForm::loadFromDataStore().

static DMAbstractForm::getCaptchaOperands ( ) [static]
Returns:
Indexed array with integer values and length of 2
Since:
0.1

Definition at line 53 of file DMAbstractForm.php.

Referenced by DMObjectTemplateHelper::getHtmlCommentsSection(), DMObjectCommentForm::init(), and DMObjectCommentForm::loadFromPOSTData().

DMAbstractForm::getFields ( )
Returns:
Array of DMFormField objects
Since:
0.4

Definition at line 96 of file DMAbstractForm.php.

Referenced by getFieldByName(), getFieldsByName(), and validate().

DMAbstractForm::getFieldsByName ( name)
Parameters:
stringname
Returns:
Array of all DMFormFields with name matching $name, or an empty array if none exist.
Since:
2.0

Definition at line 121 of file DMAbstractForm.php.

Referenced by checkRadioWithNameAndValue(), DMCPTemplateSetForm::loadFromDataStore(), DMCPEditCollectionForm::loadFromDataStore(), and loadFromPOSTData().

DMAbstractForm::init ( ) [abstract, protected]
DMAbstractForm::loadFromDataStore ( ) [protected]

Override to populate the form with values from a persistent store, if necessary; otherwise ignore.

Returns:
void

Reimplemented in UNLVHighlightAddForm, UNLVRandomAddForm, DMCPBasicSettingsForm, DMCPCommentSettingsForm, DMCPEditCollectionForm, DMCPFeedSettingsForm, DMCPRatingSettingsForm, DMCPTagSettingsForm, and DMCPTemplateSetForm.

Definition at line 146 of file DMAbstractForm.php.

DMAbstractForm::loadFromPOSTData ( array $  data) [protected]
Parameters:
dataArray of POST data; typically the return value of DMHTTPRequest::getCurrent()->getRepresentation()->getFormValue(DMAbstractForm::DATA_PREFIX)
Since:
0.4

Reimplemented in DMObjectCommentForm.

Definition at line 154 of file DMAbstractForm.php.

DMAbstractForm::validate ( )

Calls isValid() on all fields.

Returns:
void
Exceptions:
DMIllegalArgumentExceptionif a form field does not validate
Since:
0.4

Reimplemented in DMCPCommentSettingsForm.

Definition at line 208 of file DMAbstractForm.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables