You are here

public function WidgetMultivalueFormAlterEvent::__construct in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/field_event_dispatcher/src/Event/Field/WidgetMultivalueFormAlterEvent.php \Drupal\field_event_dispatcher\Event\Field\WidgetMultivalueFormAlterEvent::__construct()

WidgetMultivalueFormAlterEvent constructor.

Parameters

array $elements: The field widget form elements as constructed by \Drupal\Core\Field\WidgetBase::formMultipleElements().

\Drupal\Core\Form\FormStateInterface $formState: The current state of the form.

array $context: An associative array containing the following key-value pairs:

  • form: The form structure to which widgets are being attached. This may be a full form structure, or a sub-element of a larger form.
  • widget: The widget plugin instance.
  • items: The field values, as a \Drupal\Core\Field\FieldItemListInterface object.
  • default: A boolean indicating whether the form is being shown as a dummy form to set default values.

File

modules/field_event_dispatcher/src/Event/Field/WidgetMultivalueFormAlterEvent.php, line 54

Class

WidgetMultivalueFormAlterEvent
Class WidgetMultivalueFormAlterEvent.

Namespace

Drupal\field_event_dispatcher\Event\Field

Code

public function __construct(array &$elements, FormStateInterface $formState, array $context) {
  $this->elements =& $elements;
  $this->formState = $formState;
  $this->context = $context;
}