You are here

protected static function ElementBase::addOtherOption in Select (or other) 8

Same name and namespace in other branches
  1. 8.3 src/Element/ElementBase.php \Drupal\select_or_other\Element\ElementBase::addOtherOption()
  2. 4.x src/Element/ElementBase.php \Drupal\select_or_other\Element\ElementBase::addOtherOption()

Adds an 'other' option to the selectbox.

1 call to ElementBase::addOtherOption()
ElementBase::addSelectField in src/Element/ElementBase.php
Adds the 'select' field to the element.

File

src/Element/ElementBase.php, line 27

Class

ElementBase
Base class for select or other form elements.

Namespace

Drupal\select_or_other\Element

Code

protected static function addOtherOption($options) {
  $options['select_or_other'] = t('Other');
  return $options;
}