Same name and namespace in other branches
- 8.x-2.x src/Plugin/Field/FieldWidget/ColorFieldWidgetBox.php \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetBox::settingsForm()
Fichier
-
src/
Plugin/ Field/ FieldWidget/ ColorFieldWidgetBox.php, line 27
Classe
- ColorFieldWidgetBox
- Plugin implementation of the color_field box widget.
Namespace
Drupal\color_field\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) : array {
$element = [];
$element['default_colors'] = [
'#type' => 'textarea',
'#title' => $this->t('Default colors'),
'#default_value' => $this->getSetting('default_colors'),
'#required' => TRUE,
'#element_validate' => [
[
$this,
'settingsColorValidate',
],
],
'#description' => $this->t('Default colors for pre-selected color boxes. Enter as 6 digit upper case hex - such as #FF0000.'),
];
return $element;
}