Class miWebForm

Description

Manages a web form

  • copyright: Copyright (c) 2006,2007 Mirchev Ideas Ltd. All rights reserved.

Located in /view/WebForm.php (line 15)


	
			
Variable Summary
Method Summary
miWebForm __construct ( $formDataRow, array $formData)
void addMainPageElements ( $mainPageElements)
void addTemplateSectionInfo ( $templateSectionInfo)
void addValidator (string $fieldName, miValidator $validator)
void addWidget (string $fieldName, miBaseWidget $widget)
mixed &getFormData (string $key)
array &getFormDataRow ()
string getSubmittedData ( $fieldName)
miWidget|null getWidget (string $fieldName)
void initWidgets (array $formProperties)
void onParse (miTemplateParser &$templateParser, miTemplateParser $templateParser)
string parse (string $templateName, boolean $isEditable)
boolean processSubmit ()
void removeValidators (string $fieldName)
void setErrorsHandler ( $errorsHandler)
void setFormData (string $key, string $formData)
void setFormDataRow (array $formDataRow)
void show (string $templateName, boolean $isEditable)
Variables
mixed $_errorsHandler = null (line 64)

A reference to the error hanlder object

  • access: protected
array $_formDataRow (line 59)

Array with data to displayed by the widgets

  • access: protected
array $_formFields = array() (line 32)

Array with field objects

  • access: protected
array $_formProperties = array() (line 24)

Array that describes the output and input of each web field

  • access: protected
array $_mainPageElements = array() (line 46)
  • access: protected
mixed $_messageObj = null (line 74)

Reference to the message object, or null

  • access: protected
mixed $_submittedData = array() (line 51)
  • access: protected
mixed $_templateSectionInfos = array() (line 69)

Template section infos to be added when parsing the template

  • access: protected
array $_validators = array() (line 40)

The validators

  • access: protected
Methods
Constructor __construct (line 82)

Constructs the miWebForm

  • access: public
miWebForm __construct ( $formDataRow, array $formData)
  • array $formData
  • $formDataRow
addMainPageElements (line 248)
  • access: public
void addMainPageElements ( $mainPageElements)
  • $mainPageElements
addTemplateSectionInfo (line 136)

Adds new template section info

  • access: public
void addTemplateSectionInfo ( $templateSectionInfo)
  • $templateSectionInfo
addValidator (line 180)

Adds a validator for a field

  • access: public
void addValidator (string $fieldName, miValidator $validator)
addWidget (line 238)

Adds new form field object

  • access: public
void addWidget (string $fieldName, miBaseWidget $widget)
getFormData (line 128)

Returns a form data value

  • access: public
mixed &getFormData (string $key)
  • string $key
getFormDataRow (line 104)

Returns the form data row

  • access: public
array &getFormDataRow ()
getMessageObj (line 294)

Returns the message object if $this->_messageObj is null creates new miMessage object

  • return: the message object
  • access: protected
miMessage getMessageObj ()
getSubmittedData (line 395)

Return the submitted field value

  • access: public
string getSubmittedData ( $fieldName)
  • $fieldName
getSubmittedDataRow (line 384)

Returns the submitted data row

  • access: public
array getSubmittedDataRow ()
getWebFormErrorsHandler (line 328)

Returns the web form errors handling object

  • access: public
miWebFormErrorsHandler getWebFormErrorsHandler ()
getWidget (line 222)

Returns the widget

  • return: an object that is extends miWidget, or null if not found
  • access: public
miWidget|null getWidget (string $fieldName)
  • string $fieldName: the name of the field whose widget to return
initWidgets (line 146)

Set the form fields

  • access: public
void initWidgets (array $formProperties)
  • array $formProperties: the form properties array
onParse (line 318)

Called just before the template is parsed Subclasses can add custom functionality using this method

  • access: protected
void onParse (miTemplateParser &$templateParser, miTemplateParser $templateParser)
parse (line 260)

Parses the form template

  • return: the html for the form
  • access: public
string parse (string $templateName, boolean $isEditable)
  • string $templateName
  • boolean $isEditable: if the form will contain the editable fields/widgets
processSubmit (line 345)

Process the form submission

  • return: true on success, false if errors were found
boolean processSubmit ()
removeValidators (line 206)

Removes all validators for a field

  • access: public
void removeValidators (string $fieldName)
  • string $fieldName
setErrorsHandler (line 335)
  • access: public
void setErrorsHandler ( $errorsHandler)
  • $errorsHandler
setFormData (line 116)

Sets form data

  • access: public
void setFormData (string $key, string $formData)
  • string $key
  • string $formData
setFormDataRow (line 93)

Sets the form data row

  • access: public
void setFormDataRow (array $formDataRow)
  • array $formDataRow
show (line 307)

Shows the form

  • access: public
void show (string $templateName, boolean $isEditable)
  • string $templateName
  • boolean $isEditable: if the form will contain the editable fields/widgets

Documentation generated on Thu, 08 May 2008 16:58:01 +0300 by phpDocumentor 1.4.1