function TestFieldWidgetMultilingual::form

Same name in other branches
  1. 8.9.x core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultilingual.php \Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidgetMultilingual::form()
  2. 10 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultilingual.php \Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidgetMultilingual::form()
  3. 11.x core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultilingual.php \Drupal\field_test\Plugin\Field\FieldWidget\TestFieldWidgetMultilingual::form()

Overrides WidgetBase::form

File

core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultilingual.php, line 24

Class

TestFieldWidgetMultilingual
Plugin implementation of the 'test_field_widget_multilingual' widget.

Namespace

Drupal\field_test\Plugin\Field\FieldWidget

Code

public function form(FieldItemListInterface $items, array &$form, FormStateInterface $form_state, $get_delta = NULL) {
    $elements = parent::form($items, $form, $form_state, $get_delta);
    $elements['#multilingual'] = TRUE;
    return $elements;
}

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