Same name and namespace in other branches
- 8.x-2.x src/Plugin/Field/FieldType/ColorFieldType.php \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType::storageSettingsForm()
Fichier
-
src/
Plugin/ Field/ FieldType/ ColorFieldType.php, line 37
Classe
- ColorFieldType
- Plugin implementation of the 'color_type' field type.
Namespace
Drupal\color_field\Plugin\Field\FieldTypeCode
public function storageSettingsForm(array &$form, FormStateInterface $form_state, $has_data) : array {
$element = [];
$element['format'] = [
'#type' => 'select',
'#title' => $this->t('Format storage'),
'#description' => $this->t('Choose how to store the color.'),
'#default_value' => $this->getSetting('format'),
'#options' => [
'#HEXHEX' => $this->t('#123ABC'),
'HEXHEX' => $this->t('123ABC'),
'#hexhex' => $this->t('#123abc'),
'hexhex' => $this->t('123abc'),
],
];
return $element + parent::storageSettingsForm($form, $form_state, $has_data);
}