public function RangeItemBase::fieldSettingsForm in Range 8
Returns a form for the field-level settings.
Invoked from \Drupal\field_ui\Form\FieldConfigEditForm to allow administrators to configure field-level settings.
Parameters
array $form: The form where the settings form is being included in.
\Drupal\Core\Form\FormStateInterface $form_state: The form state of the (entire) configuration form.
Return value
array The form definition for the field settings.
Overrides FieldItemBase::fieldSettingsForm
2 calls to RangeItemBase::fieldSettingsForm()
- RangeDecimalItem::fieldSettingsForm in src/
Plugin/ Field/ FieldType/ RangeDecimalItem.php - Returns a form for the field-level settings.
- RangeFloatItem::fieldSettingsForm in src/
Plugin/ Field/ FieldType/ RangeFloatItem.php - Returns a form for the field-level settings.
2 methods override RangeItemBase::fieldSettingsForm()
- RangeDecimalItem::fieldSettingsForm in src/
Plugin/ Field/ FieldType/ RangeDecimalItem.php - Returns a form for the field-level settings.
- RangeFloatItem::fieldSettingsForm in src/
Plugin/ Field/ FieldType/ RangeFloatItem.php - Returns a form for the field-level settings.
File
- src/
Plugin/ Field/ FieldType/ RangeItemBase.php, line 64
Class
- RangeItemBase
- Base class for 'range' configurable field types.
Namespace
Drupal\range\Plugin\Field\FieldTypeCode
public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
$element = [];
$element['min'] = [
'#type' => 'number',
'#title' => $this
->t('Minimum'),
'#default_value' => $this
->getSetting('min'),
'#description' => $this
->t('The minimum value that should be allowed in this field. Leave blank for no minimum.'),
];
$element['max'] = [
'#type' => 'number',
'#title' => $this
->t('Maximum'),
'#default_value' => $this
->getSetting('max'),
'#description' => $this
->t('The maximum value that should be allowed in this field. Leave blank for no maximum.'),
];
$element += $this
->fieldSettingsFormSubElementPrefixSuffix($this
->t('FIELD'), 'field');
$element += $this
->fieldSettingsFormSubElementPrefixSuffix($this
->t('FROM'), 'from');
$element += $this
->fieldSettingsFormSubElementPrefixSuffix($this
->t('TO'), 'to');
$element += $this
->fieldSettingsFormSubElementPrefixSuffix($this
->t('COMBINED'), 'combined');
return $element;
}