MultiChoiceControl
abstract class MultiChoiceControl extends BaseControl
Choice control that allows multiple items selection.
Properties
| protected bool[] | $disabledChoices | ||
| array | $items |
Methods
No description
No description
No description
Returns selected keys.
Returns raw submitted keys without validation against the available items.
Sets items from which to choose. When $useKeys is false, values are used as keys too.
Returns items from which to choose.
Returns key-value pairs for valid, non-disabled selected items.
Disables or enables control or items.
Returns HTML name of control.
Enables or disables validation that set values exist in the items list.
Returns the item label for the given key, or throws an exception if the key does not exist.
Details
at line 30
__construct(string|Stringable|null $label = null, array|null $items = null)
No description
at line 39
void
loadHttpData()
No description
at line 48
MultiChoiceControl
setValue($values)
| internal |
No description
at line 83
array
getValue()
Returns selected keys.
at line 93
array
getRawValue()
Returns raw submitted keys without validation against the available items.
at line 103
MultiChoiceControl
setItems(array $items, bool $useKeys = true)
Sets items from which to choose. When $useKeys is false, values are used as keys too.
at line 114
array
getItems()
Returns items from which to choose.
at line 124
array
getSelectedItems()
Returns key-value pairs for valid, non-disabled selected items.
at line 140
MultiChoiceControl
setDisabled(bool|array $value = true)
Disables or enables control or items.
at line 154
string
getHtmlName()
Returns HTML name of control.
at line 163
MultiChoiceControl
checkDefaultValue(bool $value = true)
Enables or disables validation that set values exist in the items list.
at line 173
protected mixed
getItem(string|int $key)
Returns the item label for the given key, or throws an exception if the key does not exist.