Jelix 1.8.13

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

Methods

getLabel2()

Return the label corresponding to the given key.

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

It replaces getLabel() so it should be called instead of getLabel().

Parameters
$key : mixed

the key

$form : mixed

the form

Tags
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
Tags
Return values
bool

setGroupBy()

set a parameter indicating how data are grouped.

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

the group parameter

Tags
Return values
mixed

Search results