![]() |
Xataface
2.0alpha2
Xataface Application Framework
|
Public Member Functions | |
| HTML_QuickForm_Renderer_ArrayDataface ($collectHidden=false, $staticLabels=false, $assoc=true) | |
| startForm (&$form) | |
| _elementToArray (&$element, $required, $error) | |
| renderHeader (&$header) | |
A concrete renderer for HTML_QuickForm, makes an array of form contents
Based on old toArray() code.
The form array structure is the following: array( 'frozen' => 'whether the form is frozen', 'javascript' => 'javascript for client-side validation', 'attributes' => 'attributes for <form> tag', 'requirednote => 'note about the required elements', // if we set the option to collect hidden elements 'hidden' => 'collected html of all hidden elements', // if there were some validation errors: 'errors' => array( '1st element name' => 'Error for the 1st element', ... 'nth element name' => 'Error for the nth element' ), // if there are no headers in the form: 'elements' => array( element_1, ... element_N ) // if there are headers in the form: 'sections' => array( array( 'header' => 'Header text for the first header', 'name' => 'Header name for the first header', 'elements' => array( element_1, ... element_K1 ) ), ... array( 'header' => 'Header text for the Mth header', 'name' => 'Header name for the Mth header', 'elements' => array( element_1, ... element_KM ) ) ) );
where element_i is an array of the form: array( 'name' => 'element name', 'value' => 'element value', 'type' => 'type of the element', 'frozen' => 'whether element is frozen', 'label' => 'label for the element', 'required' => 'whether element is required', 'error' => 'error associated with the element', 'style' => 'some information about element style (e.g. for Smarty)', // if element is not a group 'html' => 'HTML for the element' // if element is a group 'separator' => 'separator for group elements', 'elements' => array( element_1, ... element_N ) );
public
Definition at line 98 of file ArrayDataface.php.
| _elementToArray | ( | & | $element, |
| $required, | |||
| $error | |||
| ) |
Creates an array representing an element
private
| object | An HTML_QuickForm_element object |
| bool | Whether an element is required |
| string | Error associated with the element |
Definition at line 137 of file ArrayDataface.php.
| HTML_QuickForm_Renderer_ArrayDataface | ( | $collectHidden = false, |
|
$staticLabels = false, |
|||
$assoc = true |
|||
| ) |
Constructor
| bool | true: collect all hidden elements into string; false: process them as usual form elements |
| bool | true: render an array of labels to many labels, $key 0 to 'label' and the oterh to "label_$key" public |
Definition at line 108 of file ArrayDataface.php.
| renderHeader | ( | & | $header | ) |
Definition at line 185 of file ArrayDataface.php.
| startForm | ( | & | $form | ) |
Definition at line 115 of file ArrayDataface.php.
1.8.1.2