InputfieldSelect::optionLabel() method

Get or set label for given option value/key (default language)

Available since version 3.0.134.

Usage

// basic usage
$string = $inputfieldSelect->optionLabel($key);

// usage with all arguments
$string = $inputfieldSelect->optionLabel($key, $label = null);

Arguments

NameType(s)Description
keystring, int

Option value to get or set label for

label (optional)string, null

If setting label, specify label to set. If getting, then omit.

Return value

string bool

Returns boolean false if option not found, otherwise returns option label (string).

See Also


InputfieldSelect methods and properties

API reference based on ProcessWire core version 3.0.248

Latest news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH