You are here

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

Same name and namespace in other branches
  1. 8 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::processSelectOrOther in src/Element/ElementBase.php
Render API callback: Expands the select_or_other element type.

File

src/Element/ElementBase.php, line 32
Contains Drupal\select_or_other\Element\ElementBase.

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'] = 'Other';
  return $options;
}