function WidgetBase::create

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::create()
  2. 10 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::create()
  3. 11.x 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
Creates an instance of the plugin.
DateTimeDefaultWidget::create in core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php
Creates an instance of the plugin.
FileWidget::create in core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
Creates an instance of the plugin.
MediaLibraryWidget::create in core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
Creates an instance of the plugin.
ModerationStateWidget::create in core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php
Creates an instance of the plugin.

File

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

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.