You are here

public static function PluginSelector::processFormElement in Plugin 8.2

Implements a #process callback.

File

src/Plugin/Field/FieldWidget/PluginSelector.php, line 49

Class

PluginSelector
Provides a plugin selector field widget.

Namespace

Drupal\plugin\Plugin\Field\FieldWidget

Code

public static function processFormElement(array &$element, FormStateInterface $form_state, array &$form) {

  // Store #array_parents in the form state, so we can get the elements from
  // the complete form array by using only the form state.
  $element['array_parents'] = [
    '#type' => 'value',
    '#value' => $element['#array_parents'],
  ];
  return $element;
}