function WidgetBase::create

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::create()
  2. 8.9.x core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::create()
  3. 10 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::create()

Overrides ContainerFactoryPluginInterface::create

5 methods override WidgetBase::create()
DateRangeDefaultWidget::create in core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDefaultWidget.php
DateTimeDefaultWidget::create in core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
FileWidget::create in core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
MediaLibraryWidget::create in core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
ModerationStateWidget::create in core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php

File

core/lib/Drupal/Core/Field/WidgetBase.php, line 63

Class

WidgetBase
Base class for 'Field widget' plugin implementations.

Namespace

Drupal\Core\Field

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['third_party_settings']);
}

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