function EntityReferenceEntityFormatter::settingsForm
Overrides FormatterBase::settingsForm
File
-
core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ EntityReferenceEntityFormatter.php, line 129
Class
- EntityReferenceEntityFormatter
- Plugin implementation of the 'entity reference rendered entity' formatter.
Namespace
Drupal\Core\Field\Plugin\Field\FieldFormatterCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$elements['view_mode'] = [
'#type' => 'select',
'#options' => $this->entityDisplayRepository
->getViewModeOptions($this->getFieldSetting('target_type')),
'#title' => $this->t('View mode'),
'#default_value' => $this->getSetting('view_mode'),
'#required' => TRUE,
];
return $elements;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.