Jelix 1.7.18

jFormsStaticDatasource
in package
implements jIFormsDatasource2

A datasource which is based on static values.

Tags
subpackage

forms

Interfaces, Classes and Traits

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

Table of Contents

$data  : array<string|int, mixed>
associative array which contains keys and labels.
$grouped  : mixed
getData()  : mixed
getLabel()  : mixed
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.

Properties

$data

associative array which contains keys and labels.

public array<string|int, mixed> $data = array()

Methods

getData()

public getData(mixed $form) : mixed
Parameters
$form : mixed
Return values
mixed

getLabel()

public getLabel(mixed $key) : mixed
Parameters
$key : mixed
Return values
mixed

getLabel2()

Return the label corresponding to the given key.

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

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

Parameters
$key : mixed

the key

$form : mixed

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(mixed $group) : mixed
Parameters
$group : mixed

the group parameter

Return values
mixed

Search results