Jelix 1.6.37

jIFormsDatasource2 extends jIFormsDatasource

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

..

Tags
subpackage

forms

Table of Contents

getData()  : array<string|int, mixed>
load and returns data to fill a control. The returned array should be an associative array key => label
getLabel()  : string
Return the label corresponding to the given key if the class implements also jIFormsDatasource2, you must not call getLabel but getLabel2
getLabel2()  : string
Return the label corresponding to the given key.
hasGroupedData()  : bool
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)
setGroupBy()  : mixed
set a parameter indicating how data are grouped

Methods

getData()

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

public getData(jFormsBase $form) : array<string|int, mixed>
Parameters
$form : jFormsBase

the form

Return values
array<string|int, mixed>

the data

getLabel()

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

public getLabel(string $key) : string
Parameters
$key : string

the key

Return values
string

the label

getLabel2()

Return the label corresponding to the given key.

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

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

Parameters
$key : string

the key

$form : jFormsBase

the form

Return values
string

the label

hasGroupedData()

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)

public hasGroupedData() : bool
Return values
bool

setGroupBy()

set a parameter indicating how data are grouped

public setGroupBy(string $group) : mixed
Parameters
$group : string

the group parameter

Return values
mixed

Search results