Same name and namespace in other branches
- 8.x-2.x src/Plugin/Field/FieldWidget/ColorFieldWidgetDefault.php \Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetDefault::settingsForm()
Fichier
-
src/
Plugin/ Field/ FieldWidget/ ColorFieldWidgetDefault.php, line 27
Classe
- ColorFieldWidgetDefault
- Plugin implementation of the color_widget default input widget.
Namespace
Drupal\color_field\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) : array {
$element = [];
$element['placeholder_color'] = [
'#type' => 'textfield',
'#title' => $this->t('Color placeholder'),
'#default_value' => $this->getSetting('placeholder_color'),
'#description' => $this->t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
];
$element['placeholder_opacity'] = [
'#type' => 'textfield',
'#title' => $this->t('Opacity placeholder'),
'#default_value' => $this->getSetting('placeholder_opacity'),
'#description' => $this->t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
];
return $element;
}