Returns a form to configure settings for the formatter.
Invoked from \Drupal\field_ui\Form\FieldInstanceEditForm to allow administrators to configure the formatter. The field_ui module takes care of handling submitted form values.
array $form: The form where the settings form is being included in.
array $form_state: An associative array containing the current state of the form.
array The form elements for the formatter settings.
Overrides FormatterBase::settingsForm
public function settingsForm(array $form, array &$form_state) {
$options = array(
'' => t('- None -'),
'.' => t('Decimal point'),
',' => t('Comma'),
' ' => t('Space'),
chr(8201) => t('Thin space'),
"'" => t('Apostrophe'),
);
$elements['thousand_separator'] = array(
'#type' => 'select',
'#title' => t('Thousand marker'),
'#options' => $options,
'#default_value' => $this
->getSetting('thousand_separator'),
'#weight' => 0,
);
$elements['prefix_suffix'] = array(
'#type' => 'checkbox',
'#title' => t('Display prefix and suffix.'),
'#default_value' => $this
->getSetting('prefix_suffix'),
'#weight' => 10,
);
return $elements;
}