You are here

field_formatter.module in (Entity Reference) Field Formatters 8

Same filename and directory in other branches
  1. 8.2 field_formatter.module
  2. 3.x field_formatter.module

Hook implementations for the Field formatter module.

File

field_formatter.module
View source
<?php

/**
 * @file
 * Hook implementations for the Field formatter module.
 */

/**
 * Implements hook_field_formatter_info_alter().
 */
function field_formatter_field_formatter_info_alter(array &$info) {

  /** @var \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager */
  $field_type_manager = \Drupal::service('plugin.manager.field.field_type');
  $field_types = array_keys($field_type_manager
    ->getDefinitions());
  $info['field_link']['field_types'] = $field_types;
}