public static function DynamicEntityReferenceEntityFormatter::defaultSettings in Dynamic Entity Reference 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/DynamicEntityReferenceEntityFormatter.php \Drupal\dynamic_entity_reference\Plugin\Field\FieldFormatter\DynamicEntityReferenceEntityFormatter::defaultSettings()
Defines the default settings for this plugin.
Return value
array A list of default settings, keyed by the setting name.
Overrides EntityReferenceEntityFormatter::defaultSettings
File
- src/
Plugin/ Field/ FieldFormatter/ DynamicEntityReferenceEntityFormatter.php, line 37
Class
- DynamicEntityReferenceEntityFormatter
- Plugin implementation of the 'rendered entity' formatter.
Namespace
Drupal\dynamic_entity_reference\Plugin\Field\FieldFormatterCode
public static function defaultSettings() {
$labels = \Drupal::service('entity_type.repository')
->getEntityTypeLabels(TRUE);
$options = array_keys($labels[(string) t('Content', [], [
'context' => 'Entity type group',
])]);
return array_fill_keys($options, [
'view_mode' => 'default',
'link' => FALSE,
]);
}