You are here

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

Same name and namespace in other branches
  1. 8.3 src/Element/Select.php \Drupal\select_or_other\Element\Select::processSelectOrOther()
  2. 4.x src/Element/Select.php \Drupal\select_or_other\Element\Select::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 Select::processSelectOrOther()
SelectElementTest::testProcessSelectOrOther in tests/src/Unit/SelectElementTest.php
Tests the processing of a select or other element.

File

src/Element/Select.php, line 20

Class

Select
Provides a form element with a select box 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::addEmptyOption($element);
  static::addStatesHandling($element);
  return $element;
}