InputfieldSelect::insertOptionsBefore()

Insert new options before an existing option (or prepend options to beginning)

Available since version 3.0.134.

Usage

// basic usage
$self = $inputfieldSelect->insertOptionsBefore(array $options);

// usage with all arguments
$self = $inputfieldSelect->insertOptionsBefore(array $options, $existingValue = null);

Arguments

NameType(s)Description
$optionsarray

Associative array of [ 'value' => 'label' ] containing new options to add.

$existingValue (optional)string int null

Existing option value to add options before, or omit to add at beginning.

Return value

self


InputfieldSelect methods and properties

API reference based on ProcessWire core version 3.0.251