You are here

public function SelectOrOtherWidgetBase::settingsForm in Select (or other) 8.3

Returns a form to configure settings for the widget.

Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the widget. The field_ui module takes care of handling submitted form values.

Parameters

array $form: The form where the settings form is being included in.

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

Return value

array The form definition for the widget settings.

Overrides WidgetBase::settingsForm

1 call to SelectOrOtherWidgetBase::settingsForm()
Widget::settingsForm in src/Plugin/Field/FieldWidget/Widget.php
Returns a form to configure settings for the widget.
1 method overrides SelectOrOtherWidgetBase::settingsForm()
Widget::settingsForm in src/Plugin/Field/FieldWidget/Widget.php
Returns a form to configure settings for the widget.

File

src/Plugin/Field/FieldWidget/SelectOrOtherWidgetBase.php, line 94
Contains \Drupal\select_or_other\Plugin\Field\FieldWidget\SelectOrOtherWidgetBase.

Class

SelectOrOtherWidgetBase
Base class for the 'select_or_other_*' widgets.

Namespace

Drupal\select_or_other\Plugin\Field\FieldWidget

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form = parent::settingsForm($form, $form_state);
  $form['select_element_type'] = [
    '#title' => $this
      ->t('Type of select form element'),
    '#type' => 'select',
    '#options' => $this
      ->selectElementTypeOptions(),
    '#default_value' => $this
      ->getSetting('select_element_type'),
  ];
  return $form;
}