Same name in other branches
- 8.x-2.x src/Plugin/Field/FieldWidget/ColorFieldWidgetHTML5.php \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetHTML5
Plugin implementation of the color_field spectrum widget.
Plugin annotation
@FieldWidget(
id = "color_field_widget_html5",
module = "color_field",
label = @Translation("Color HTML5"),
field_types = {
"color_field_type"
}
)
Hierarchy
- class \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetBase extends \Drupal\Core\Field\WidgetBase
- class \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetHTML5 extends \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetBase
Expanded class hierarchy of ColorFieldWidgetHTML5
File
-
src/
Plugin/ Field/ FieldWidget/ ColorFieldWidgetHTML5.php, line 22
Namespace
Drupal\color_field\Plugin\Field\FieldWidgetView source
class ColorFieldWidgetHTML5 extends ColorFieldWidgetBase {
/**
* {@inheritdoc}
*/
public function settingsForm(array $form, FormStateInterface $form_state) : array {
return [];
}
/**
* {@inheritdoc}
*/
public function settingsSummary() : array {
return [];
}
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
public static function defaultSettings() : array {
return [];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ColorFieldWidgetHTML5::defaultSettings | public static | function | ||
ColorFieldWidgetHTML5::formElement | public | function | Overrides ColorFieldWidgetBase::formElement | |
ColorFieldWidgetHTML5::settingsForm | public | function | ||
ColorFieldWidgetHTML5::settingsSummary | public | function |