public function EntityReferenceEntityFormatter::settingsSummary in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter::settingsSummary()
Returns a short summary for the current formatter settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.
Return value
string[] A short summary of the formatter settings.
Overrides FormatterBase::settingsSummary
File
- core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ EntityReferenceEntityFormatter.php, line 109 - Contains \Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceEntityFormatter.
Class
- EntityReferenceEntityFormatter
- Plugin implementation of the 'entity reference rendered entity' formatter.
Namespace
Drupal\Core\Field\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = array();
$view_modes = \Drupal::entityManager()
->getViewModeOptions($this
->getFieldSetting('target_type'));
$view_mode = $this
->getSetting('view_mode');
$summary[] = t('Rendered as @mode', array(
'@mode' => isset($view_modes[$view_mode]) ? $view_modes[$view_mode] : $view_mode,
));
return $summary;
}