function BaseFieldFileFormatterBase::create

Same name in other branches
  1. 9 core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::create()
  2. 11.x core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\BaseFieldFileFormatterBase::create()

Overrides FormatterBase::create

File

core/modules/file/src/Plugin/Field/FieldFormatter/BaseFieldFileFormatterBase.php, line 53

Class

BaseFieldFileFormatterBase
Base class for file formatters, which allow to link to the file download URL.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings'], $configuration['label'], $configuration['view_mode'], $configuration['third_party_settings'], $container->get('file_url_generator'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.