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
Name | Type(s) | Description |
---|---|---|
key | string, 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.236