InputfieldSelect::insertOptionsBefore() method

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.244

“…building with ProcessWire was a breeze, I really love all the flexibility the system provides. I can’t imagine using any other CMS in the future.” —Thomas Aull