function ResponsiveImageFormatter::create

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

Overrides FormatterBase::create

File

core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php, line 96

Class

ResponsiveImageFormatter
Plugin for responsive image formatter.

Namespace

Drupal\responsive_image\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('entity_type.manager')
        ->getStorage('responsive_image_style'), $container->get('entity_type.manager')
        ->getStorage('image_style'), $container->get('link_generator'), $container->get('current_user'));
}

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