Class DataForm

Description

Incapsulates HTML form. Used to construct type-safe HTML forms.

Located in /src/class.DataForm.php (line 18)


	
			
Variable Summary
 array $Fields
 string $InlineHelp
 mixed $Validators
 SimpleXMLElement $XMLValidator
Method Summary
 DataForm AddValidator (callable $callable, [string $field = null])
 DataForm AddXMLValidator ( $manifest)
 void AppendField (DataFormField $field, [ $fieldset = null])
 void AppendFieldFromXML ( $xmlfield, [ $name = null], string $newname)
 void AppendFromXML ( $root)
 void Bind ( $data)
 void ClearFields ()
 unknown GetInlineHelp ()
 array ListFields ([ $fieldset = null])
 void ListFieldsets ()
 void SaveToXML ([ $root = null])
 void SetInlineHelp (string $inline_help)
 void Validate ( $data)
Variables
array $Fields (line 27)

Form fields. Array of DataForm objects.

  • access: protected
string $InlineHelp (line 34)

Inline help that will appear in yellow box above the form, if Inline help is enabled in registrar/registant CP.

  • access: protected
mixed $Validators = array() (line 43)
  • access: protected
SimpleXMLElement $XMLValidator (line 41)

XML manifest

  • access: protected
Methods
AddValidator (line 277)

Add custom validator callback. It will be called for field, named $field with args:

name string field name value mixed field value data array all data passed for validation

DataForm AddValidator (callable $callable, [string $field = null])
  • callable $callable
  • string $field: Field name, if no any -- callback will be used for each field
AddXMLValidator (line 261)

Add form manifest for validation

DataForm AddXMLValidator ( $manifest)
  • SimpleXMLElement $manifest
AppendField (line 72)

Append form field.

void AppendField (DataFormField $field, [ $fieldset = null])
  • FormField $field
  • $fieldset
AppendFieldFromXML (line 133)

Append form field from XML definition

  • access: public
void AppendFieldFromXML ( $xmlfield, [ $name = null], string $newname)
  • SimpleXMLElement $xmlfield: xml definition of the field
  • string $newname: Name of the attached field. By default takes from xml
  • $name
AppendFromXML (line 119)
  • access: public
void AppendFromXML ( $root)
  • SimpleXMLElement $root
Bind (line 284)
void Bind ( $data)
  • $data
ClearFields (line 104)

Clear fields

void ClearFields ()
GetFieldByName (line 114)

Return field object by name

DataFormField GetFieldByName ( $name)
  • $name
GetInlineHelp (line 53)

Returns Inline help that will appear in yellow box above the form, if Inline help is enabled in registrar/registant CP.

unknown GetInlineHelp ()
ListFields (line 89)

Returns array of form fields (DataFormField objects);

array ListFields ([ $fieldset = null])
  • $fieldset
ListFieldsets (line 94)
void ListFieldsets ()
SaveToXML (line 166)
  • access: public
void SaveToXML ([ $root = null])
  • $root
SetInlineHelp (line 63)

Set Inline help that will appear in yellow box above the form, if Inline help is enabled in registrar/registant CP.

void SetInlineHelp (string $inline_help)
  • string $inline_help
Validate (line 239)
void Validate ( $data)
  • $data

Documentation generated on Thu, 22 Apr 2010 15:16:23 +0300 by phpDocumentor 1.4.1