public function SvgImageWidget::__construct in Svg Image 8
Same name and namespace in other branches
- 2.x src/Plugin/Field/FieldWidget/SvgImageWidget.php \Drupal\svg_image\Plugin\Field\FieldWidget\SvgImageWidget::__construct()
- 1.x src/Plugin/Field/FieldWidget/SvgImageWidget.php \Drupal\svg_image\Plugin\Field\FieldWidget\SvgImageWidget::__construct()
Constructs a WidgetBase 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.
Overrides FileWidget::__construct
File
- src/
Plugin/ Field/ FieldWidget/ SvgImageWidget.php, line 74
Class
- SvgImageWidget
- Override plugin of the 'image_image' widget.
Namespace
Drupal\svg_image\Plugin\Field\FieldWidgetCode
public function __construct($pluginId, $pluginDefinition, FieldDefinitionInterface $fieldDefinition, array $settings, array $thirdPartySettings, ContainerInterface $container) {
parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $thirdPartySettings, $container
->get('element_info'));
$this->container = $container;
$this->entityRepository = $container
->get('entity.repository');
$this->renderer = $container
->get('renderer');
$this->entityTypeManager = $container
->get('entity_type.manager');
$this->imageStyleStorage = $this->entityTypeManager
->getStorage('image_style');
$this->imageFactory = $container
->get('image.factory');
}