You are here

function field_group_field_formatter_options in Field Group 8

Same name and namespace in other branches
  1. 7.2 field_group.field_ui.inc \field_group_field_formatter_options()
  2. 7 field_group.field_ui.inc \field_group_field_formatter_options()

Return an array of field_group_formatter options.

1 call to field_group_field_formatter_options()
field_group_field_ui_display_form_alter in includes/field_ui.inc
Function to alter the display overview screens.

File

includes/helpers.inc, line 21

Code

function field_group_field_formatter_options($type) {
  $options =& drupal_static(__FUNCTION__);
  if (!isset($options)) {
    $options = array();
    $manager = Drupal::service('plugin.manager.field_group.formatters');
    $formatters = $manager
      ->getDefinitions();
    foreach ($formatters as $formatter) {
      if (in_array($type, $formatter['supported_contexts'])) {
        $options[$formatter['id']] = $formatter['label'];
      }
    }
  }
  return $options;
}