jIFormsDatasource2

Extends \jIFormsDatasource

Interface for objects which provides a source of data to fill some controls in a form, like menulist, listbox etc.

..

package

jelix

subpackage

forms

Methods

load and returns data to fill a control. The returned array should be an associative array key => label

getData(\jFormsBase $form) : array
inherited

Arguments

$form

\jFormsBase

the form

Response

array

the data

Return the label corresponding to the given key if the class implements also jIFormsDatasource2, you must not call getLabel but getLabel2

getLabel(string $key) : string
inherited

Arguments

$key

string

the key

Response

string

the label

Return the label corresponding to the given key.

getLabel2(string $key, \jFormsBase $form) : string

It replace getLabel so it should be called instead of getLabel.

Arguments

$key

string

the key

$form

\jFormsBase

the form

Response

string

the label

Says if data are grouped, ie, if getData() returns a simple array value=>label (false) or if it returns an array of simple arrays array('group label'=>array(value=>label,)) (true)

hasGroupedData() : boolean

Response

boolean

set a parameter indicating how data are grouped

setGroupBy(string $group) 

Arguments

$group

string

the group parameter