public static function CshsElement::processElement in Client-side Hierarchical Select 8.2
Same name and namespace in other branches
- 8.3 src/Element/CshsElement.php \Drupal\cshs\Element\CshsElement::processElement()
- 8 src/Element/CshsElement.php \Drupal\cshs\Element\CshsElement::processElement()
File
- src/
Element/ CshsElement.php, line 78
Class
- CshsElement
- Defines the CSHS element.
Namespace
Drupal\cshs\ElementCode
public static function processElement(array $element) : array {
\assert(Inspector::assertAllStringable($element['#labels']));
$element['#attached']['library'][] = 'cshs/cshs.base';
$element['#attached']['drupalSettings'][static::ID][$element['#id']] = [
'labels' => $element['#labels'],
'noneLabel' => $element['#none_label'],
'noneValue' => $element['#none_value'],
'noFirstLevelNone' => $element['#no_first_level_none'],
];
static::setAttributes($element, [
'simpler-select-root',
'form-element',
'form-element--type-select',
]);
return $element;
}