Same name and namespace in other branches
- 3.0.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 50
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) {
$element = parent::formElement($items, $delta, $element, $form, $form_state);
$element['color']['#type'] = 'color';
return $element;
}