Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ImageWidget.php

function ImageWidget::__construct

Constructs an ImageWidget object.

Parameters

string $plugin_id: The plugin ID for the widget.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the widget is associated.

array $settings: The widget settings.

array $third_party_settings: Any third party settings.

\Drupal\Core\Render\ElementInfoManagerInterface $element_info: The element info manager service.

\Drupal\Core\Image\ImageFactory $image_factory: The image factory service.

Overrides FileWidget::__construct

File

core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php, line 51

Class

ImageWidget
Plugin implementation of the 'image_image' widget.

Namespace

Drupal\image\Plugin\Field\FieldWidget

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, ElementInfoManagerInterface $element_info, ?ImageFactory $image_factory = NULL) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings, $element_info);
    $this->imageFactory = $image_factory ?: \Drupal::service('image.factory');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal