\formField

Defines the base functions required from a form field.

Summary

Methods
Constants
displayField()
onSave()
getCSS()
getTopJS()
getBottomJS()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

displayField()

displayField(  $f) 

Returns the HTML code for displaying the field, initialized with the data supplied in $fieldData

Parameters

$f

fieldData : this stdClass object contains all the field info. Defining the function arguments into an object avoids redefining all existing functions already issued when a new argument requires to be added to the calls. $f->formID // value of the id attribute of the

tag this field is included in $f->mode // the mode value allows discriminating between templates (mode=="template|") and microtemplates (mode=="micro|") $f->dataType // this is an numeric array of every arguments included in the 'dataType' index of the field. example : $MyField['dataType']='input text' gets available as array(0 => 'input', 1=> 'text') $f->key // this is the unique key (or field name/identifier ) for the currentField. Exemple : 'clientName' $f->fieldData // this is the data array of the current field $f->recordUid // the uid (Unique ID) of the record containing the current field $f->recordClassName // the class name of the record containing the current field $f->record // all the data for the record containing the current field $f->microKey // field name when processing a microTemplate field (only used when mode=="micro|") $f->microIndex // sorting index when processing a microTemplate field (only used when mode=="micro|")

onSave()

onSave(  $fieldData,   $value) : mixed

Process the field value prior saving it to the database, whenever inner value adaptation is required, for SQL strict compliance for example.

This is executed after 'preRecord' processing functions.

Parameters

$fieldData

this is the data array of the current field

$value

this is the submited value

Returns

mixed

getCSS()

getCSS() 

Returns the HTML code necessary to add the CSS files required by this field

getTopJS()

getTopJS() 

Returns the HTML code necessary to add at the top of the HTML page the JS files or scripts required by this field

getBottomJS()

getBottomJS() 

Returns the HTML code necessary to add at the bottom of the HTML page the JS files or scripts required by this field