Xataface 2.0
Xataface Application Framework
Public Member Functions
HTML_QuickForm_Renderer_ArrayDataface Class Reference

Public Member Functions

 HTML_QuickForm_Renderer_ArrayDataface ($collectHidden=false, $staticLabels=false, $assoc=true)
 startForm (&$form)
 _elementToArray (&$element, $required, $error)
 renderHeader (&$header)

Detailed Description

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.


Member Function Documentation

_elementToArray ( &$  element,
required,
error 
)

Creates an array representing an element

private

Parameters:
objectAn HTML_QuickForm_element object
boolWhether an element is required
stringError associated with the element
Returns:
array

Definition at line 134 of file ArrayDataface.php.

HTML_QuickForm_Renderer_ArrayDataface ( collectHidden = false,
staticLabels = false,
assoc = true 
)

Constructor

Parameters:
booltrue: collect all hidden elements into string; false: process them as usual form elements
booltrue: 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 182 of file ArrayDataface.php.

startForm ( &$  form)

Definition at line 115 of file ArrayDataface.php.


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