You are here

public function FieldGroupFormatterPluginManager::getDefaultSettings in Field Group 8

Same name and namespace in other branches
  1. 8.3 src/FieldGroupFormatterPluginManager.php \Drupal\field_group\FieldGroupFormatterPluginManager::getDefaultSettings()

Returns the default settings of a field_group formatter.

Parameters

string $type: A formatter type name.

string $context: The context to get default values for.

Return value

array The formatter type's default settings, as provided by the plugin definition, or an empty array if type or settings are undefined.

1 call to FieldGroupFormatterPluginManager::getDefaultSettings()
FieldGroupFormatterPluginManager::prepareConfiguration in src/FieldGroupFormatterPluginManager.php
Merges default values for formatter configuration.

File

src/FieldGroupFormatterPluginManager.php, line 134

Class

FieldGroupFormatterPluginManager
Plugin type manager for all fieldgroup formatters.

Namespace

Drupal\field_group

Code

public function getDefaultSettings($type, $context) {
  $plugin_definition = $this
    ->getDefinition($type, FALSE);
  if (!empty($plugin_definition['class'])) {
    $plugin_class = DefaultFactory::getPluginClass($type, $plugin_definition);
    return $plugin_class::defaultContextSettings($context);
  }
  return array();
}