You are here

public static function FieldSlideshow::create in Field Slideshow 8.3

Use symfony dependency injection container.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: Container.

array $configuration: Configuration.

string $plugin_id: Plugin id.

mixed $plugin_definition: Plugin definition.

Return value

\Drupal\Core\Plugin\ContainerFactoryPluginInterface|\Drupal\field_slideshow\Plugin\Field\FieldFormatter\FieldSlideshow|\Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter Container.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides ImageFormatter::create

File

src/Plugin/Field/FieldFormatter/FieldSlideshow.php, line 121

Class

FieldSlideshow
Plugin implementation of the 'slideshow' formatter.

Namespace

Drupal\field_slideshow\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('current_user'), $container
    ->get('entity_type.manager')
    ->getStorage('image_style'), $container
    ->get('module_handler'), $container
    ->get('renderer'), $container
    ->get('plugin.manager.field_slideshow_pager'));
}