ChoiceInputTrait
trait ChoiceInputTrait
Trait ChoiceInputTrait.
Provides basic functionality for inputs where one of more than one predefined values are possible.
Properties
protected array | $rawItems |
Methods
Processes an associative array in a way that it has no nesting. Keys for nested arrays are lost, but nested arrays are merged.
Makes array of <option>. Can handle associative arrays just fine. Checks for duplicate values.
No description
Check if whole control is disabled.
Check if a specific value is disabled. If whole control is disabled, returns false.
Self-explanatory
Details
at line 35
array
flatAssocArray(array $array)
Processes an associative array in a way that it has no nesting. Keys for nested arrays are lost, but nested arrays are merged.
at line 59
array
makeOptionList(array $items, callable $optionArgs, array $valuesRendered =
[])
Makes array of <option>. Can handle associative arrays just fine. Checks for duplicate values.
at line 100
ChoiceInputTrait
setItems(array $items, bool $useKeys = TRUE)
at line 117
protected bool
isControlDisabled()
Check if whole control is disabled.
This is false if only a set of values is disabled
at line 131
protected bool
isValueDisabled($value)
Check if a specific value is disabled. If whole control is disabled, returns false.
at line 149
protected bool
isValueSelected($value)
Self-explanatory