class SelectBox extends ChoiceControl

Select box control that allows single item selection.

Constants

Valid

validation rule

deprecated VALID

Methods

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

No description

setPrompt(string|Stringable|false $prompt)

Sets first prompt item in select box.

string|Stringable|false
getPrompt()

Returns first prompt item.

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

Sets options and option groups from which to choose.

Html|string
getControl()

Generates control's HTML element.

addOptionAttributes(array $attributes) deprecated

No description

setOptionAttribute(string $name, mixed $value = true)

No description

bool
isOk()

No description

array
getOptionAttributes()

No description

Details

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

No description

Parameters

$label
array|null $items

at line 48
SelectBox setPrompt(string|Stringable|false $prompt)

Sets first prompt item in select box.

Parameters

string|Stringable|false $prompt

Return Value

SelectBox

at line 58
string|Stringable|false getPrompt()

Returns first prompt item.

Return Value

string|Stringable|false

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

Sets options and option groups from which to choose.

Parameters

array $items
bool $useKeys

Return Value

ChoiceControl

at line 91
Html|string getControl()

Generates control's HTML element.

Return Value

Html|string

at line 120
SelectBox addOptionAttributes(array $attributes) deprecated

deprecated use setOptionAttribute()

No description

Parameters

array $attributes

Return Value

SelectBox

at line 127
SelectBox setOptionAttribute(string $name, mixed $value = true)

No description

Parameters

string $name
mixed $value

Return Value

SelectBox

at line 134
bool isOk()

No description

Return Value

bool

at line 144
array getOptionAttributes()

No description

Return Value

array