Same name and namespace in other branches
- 3.0.x src/Plugin/Field/FieldType/ColorFieldType.php \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType::storageSettingsForm()
Fichier
-
src/
Plugin/ Field/ FieldType/ ColorFieldType.php, line 53
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) {
$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'),
],
];
$element += parent::storageSettingsForm($form, $form_state, $has_data);
return $element;
}