function FieldWidget::__construct

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Field/Attribute/FieldWidget.php \Drupal\Core\Field\Attribute\FieldWidget::__construct()

Constructs a FieldWidget attribute.

Parameters

string $id: The plugin ID.

\Drupal\Core\StringTranslation\TranslatableMarkup|null $label: (optional) The human-readable name of the widget type.

\Drupal\Core\StringTranslation\TranslatableMarkup|null $description: (optional) A short description of the widget type.

string[] $field_types: (optional) An array of field types the widget supports.

bool $multiple_values: (optional) Does the field widget handles multiple values at once.

int|null $weight: (optional) An integer to determine weight of this widget relative to other widgets. Other widgets are in the Field UI when selecting a widget for a given field.

class-string|null $deriver: (optional) The deriver class.

Overrides Plugin::__construct

File

core/lib/Drupal/Core/Field/Attribute/FieldWidget.php, line 46

Class

FieldWidget
Defines a FieldWidget attribute for plugin discovery.

Namespace

Drupal\Core\Field\Attribute

Code

public function __construct(string $id, ?TranslatableMarkup $label = NULL, ?TranslatableMarkup $description = NULL, array $field_types = [], bool $multiple_values = FALSE, ?int $weight = NULL, ?string $deriver = NULL) {
}

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