You are here

public static function DropzoneJsEbWidget::create in DropzoneJS 8.2

Same name and namespace in other branches
  1. 8 modules/eb_widget/src/Plugin/EntityBrowser/Widget/DropzoneJsEbWidget.php \Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget\DropzoneJsEbWidget::create()
1 call to DropzoneJsEbWidget::create()
MediaEntityDropzoneJsEbWidget::create in modules/eb_widget/src/Plugin/EntityBrowser/Widget/MediaEntityDropzoneJsEbWidget.php
1 method overrides DropzoneJsEbWidget::create()
MediaEntityDropzoneJsEbWidget::create in modules/eb_widget/src/Plugin/EntityBrowser/Widget/MediaEntityDropzoneJsEbWidget.php

File

modules/eb_widget/src/Plugin/EntityBrowser/Widget/DropzoneJsEbWidget.php, line 69

Class

DropzoneJsEbWidget
Provides an Entity Browser widget that uploads new files.

Namespace

Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget

Code

public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
  $widget = parent::create($container, $configuration, $plugin_id, $plugin_definition);
  $widget
    ->setDropzoneJsUploadSave($container
    ->get('dropzonejs.upload_save'));
  $widget
    ->setCurrentUser($container
    ->get('current_user'));
  $widget
    ->setToken($container
    ->get('token'));
  $widget
    ->setFileSystem($container
    ->get('file_system'));
  $widget
    ->setLibraryDiscovery($container
    ->get('library.discovery'));
  return $widget;
}