MultiChoiceControl
abstract class MultiChoiceControl extends BaseControl
Choice control that allows multiple items selection.
Properties
| protected bool[] | $disabledChoices | ||
| array | $items |
Methods
No description
Loads HTTP data.
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 31
__construct(string|Stringable|null $label = null, array|null $items = null)
No description
at line 40
void
loadHttpData()
Loads HTTP data.
at line 47
Control
setValue($values)
| internal |
No description
at line 82
mixed
getValue()
Returns selected keys.
at line 92
array
getRawValue()
Returns raw submitted keys without validation against the available items.
at line 102
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 113
array
getItems()
Returns items from which to choose.
at line 123
array
getSelectedItems()
Returns key-value pairs for valid, non-disabled selected items.
at line 139
BaseControl
setDisabled(bool|array $value = true)
Disables or enables control or items.
at line 153
string
getHtmlName()
Returns HTML name of control.
at line 162
MultiChoiceControl
checkDefaultValue(bool $value = true)
Enables or disables validation that set values exist in the items list.
at line 172
protected mixed
getItem(mixed $key)
Returns the item label for the given key, or throws an exception if the key does not exist.