function Select::preRenderSelect

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/Element/Select.php \Drupal\Core\Render\Element\Select::preRenderSelect()
  2. 10 core/lib/Drupal/Core/Render/Element/Select.php \Drupal\Core\Render\Element\Select::preRenderSelect()
  3. 11.x core/lib/Drupal/Core/Render/Element/Select.php \Drupal\Core\Render\Element\Select::preRenderSelect()

Prepares a select render element.

File

core/lib/Drupal/Core/Render/Element/Select.php, line 195

Class

Select
Provides a form element for a drop-down menu or scrolling selection box.

Namespace

Drupal\Core\Render\Element

Code

public static function preRenderSelect($element) {
    Element::setAttributes($element, [
        'id',
        'name',
        'size',
    ]);
    static::setAttributes($element, [
        'form-select',
    ]);
    return $element;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.