Same name and namespace in other branches
- 8.x-2.x src/Plugin/Field/FieldWidget/ColorFieldWidgetHTML5.php \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetHTML5::formElement()
Overrides ColorFieldWidgetBase::formElement
Fichier
-
src/
Plugin/ Field/ FieldWidget/ ColorFieldWidgetHTML5.php, line 41
Classe
- ColorFieldWidgetHTML5
- Plugin implementation of the color_field spectrum widget.
Namespace
Drupal\color_field\Plugin\Field\FieldWidgetCode
public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) : array {
$element = parent::formElement($items, $delta, $element, $form, $form_state);
$element['color']['#type'] = 'color';
return $element;
}