You are here

public static function Buttons::processSelectOrOther in Select (or other) 8

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

Render API callback: Expands the select_or_other element type.

Expands the select or other element to have a 'select' and 'other' field.

Overrides ElementBase::processSelectOrOther

1 call to Buttons::processSelectOrOther()
ButtonsElementTest::testProcessSelectOrOther in tests/src/Unit/ButtonsElementTest.php
Tests the processing of a select or other element.

File

src/Element/Buttons.php, line 19

Class

Buttons
Provides a form element with buttons and other option.

Namespace

Drupal\select_or_other\Element

Code

public static function processSelectOrOther(&$element, FormStateInterface $form_state, &$complete_form) {
  $element = parent::processSelectOrOther($element, $form_state, $complete_form);
  static::setSelectType($element);
  static::addStatesHandling($element);
  static::addEmptyOption($element);
  return $element;
}