class MultiselectInput extends MultiSelectBox implements IValidationInput

Class MultiselectInput.

Selectbox where multiple options can be selected.

Traits

Trait ChoiceInputTrait.
Trait InputPromptTrait.
Trait StandardValidationTrait.

Properties

protected array $rawItems from  ChoiceInputTrait
string $prompt from  InputPromptTrait

Methods

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.

array
makeOptionList(array $items, callable $optionArgs, array $valuesRendered = [])

Makes array of <option>. Can handle associative arrays just fine. Checks for duplicate values.

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

No description

bool
isControlDisabled()

Check if whole control is disabled.

bool
isValueDisabled($value)

Check if a specific value is disabled. If whole control is disabled, returns false.

bool
isValueSelected($value)

Self-explanatory

null|string
getPrompt()

No description

setPrompt(null|string $prompt)

Sets the first unselectable item on list. Its value is null.

Html
showValidation( Html $control)

Modify control in such a way that it explicitly shows its validation state.

__construct($label = NULL, array $items = NULL)

No description

getControl()

No description

Details

in ChoiceInputTrait 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.

Parameters

array $array

Return Value

array

in ChoiceInputTrait 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.

Parameters

array $items
callable $optionArgs takes ($value,$caption) and spits out an array of <option> attributes
array $valuesRendered for internal use. Do not change.

Return Value

array

Exceptions

InvalidArgumentException when $items have multiple of the same values

in ChoiceInputTrait at line 100
ChoiceInputTrait setItems(array $items, bool $useKeys = TRUE)

Parameters

array $items Items to set. Associative arrays are supported.
bool $useKeys

Return Value

ChoiceInputTrait

in ChoiceInputTrait at line 117
protected bool isControlDisabled()

Check if whole control is disabled.

This is false if only a set of values is disabled

Return Value

bool

in ChoiceInputTrait at line 131
protected bool isValueDisabled($value)

Check if a specific value is disabled. If whole control is disabled, returns false.

Parameters

$value mixed value to check for

Return Value

bool

in ChoiceInputTrait at line 149
protected bool isValueSelected($value)

Self-explanatory

Parameters

$value

Return Value

bool

in InputPromptTrait at line 33
null|string getPrompt()

Return Value

null|string

in InputPromptTrait at line 43
InputPromptTrait setPrompt(null|string $prompt)

Sets the first unselectable item on list. Its value is null.

Parameters

null|string $prompt

Return Value

InputPromptTrait

Html showValidation( Html $control)

Modify control in such a way that it explicitly shows its validation state.

Returns the modified element.

Parameters

Html $control

Return Value

Html

at line 30
__construct($label = NULL, array $items = NULL)

Parameters

$label
array $items

at line 39
getControl()