abstract class ChoiceControl extends BaseControl

Choice control that allows single item selection.

Properties

protected bool[] $disabledChoices
array $items
mixed read-only $selectedItem

Methods

__construct($label = null, array|null $items = null)

No description

void
loadHttpData()

Loads HTTP data.

setValue(mixed $value)

Sets selected item (by key).

mixed
getValue()

Returns selected key.

string|int|null
getRawValue()

Returns selected key (not checked).

bool
isFilled()

Is any item selected?

setItems(array $items, bool $useKeys = true)

Sets items from which to choose.

array
getItems()

Returns items from which to choose.

mixed
getSelectedItem()

Returns selected value.

setDisabled(bool|array $value = true)

Disables or enables control or items.

checkDefaultValue(bool $value = true)

No description

Details

at line 32
__construct($label = null, array|null $items = null)

No description

Parameters

$label
array|null $items

at line 41
void loadHttpData()

Loads HTTP data.

Return Value

void

at line 53
Control setValue(mixed $value)

internal  
 

Sets selected item (by key).

Parameters

mixed $value

Return Value

Control

at line 79
mixed getValue()

Returns selected key.

Return Value

mixed

at line 92
string|int|null getRawValue()

Returns selected key (not checked).

Return Value

string|int|null

at line 101
bool isFilled()

Is any item selected?

Return Value

bool

at line 110
ChoiceControl setItems(array $items, bool $useKeys = true)

Sets items from which to choose.

Parameters

array $items
bool $useKeys

Return Value

ChoiceControl

at line 123
array getItems()

Returns items from which to choose.

Return Value

array

at line 132
mixed getSelectedItem()

Returns selected value.

Return Value

mixed

at line 145
BaseControl setDisabled(bool|array $value = true)

Disables or enables control or items.

Parameters

bool|array $value

Return Value

BaseControl

at line 156
ChoiceControl checkDefaultValue(bool $value = true)

No description

Parameters

bool $value

Return Value

ChoiceControl