Add options only if they are non-blank
We don't need blank options in a select multiple since the unselected state involves no selected options
Usage
// basic usage
$inputfieldSelect = $inputfieldSelectMultiple->addOption($value);
// usage with all arguments
$inputfieldSelect = $inputfieldSelectMultiple->addOption($value, $label = null, array $attributes = null);
Arguments
Name | Type(s) | Description |
---|---|---|
value | string, int | Value that the option submits (or label of optgroup, if specifying an optgroup) |
label (optional) | string, null | |
attributes (optional) | array | Optional attributes to be associated with this option (i.e. a 'selected' attribute for an |
Return value
InputfieldSelect
InputfieldSelectMultiple
self
Object instance it was called from (method supports fluent interface).
InputfieldSelectMultiple methods and properties
API reference based on ProcessWire core version 3.0.236