You are here

public function TextWithTitleTabsVerticalFormatter::settingsForm in Text with Title Field 8

Returns a form to configure settings for the formatter.

Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the formatter. 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 elements for the formatter settings.

Overrides FormatterBase::settingsForm

File

src/Plugin/Field/FieldFormatter/TextWithTitleTabsVerticalFormatter.php, line 38

Class

TextWithTitleTabsVerticalFormatter
Plugin implementation of the 'TextWithTitleTabsVerticalFormatter' formatter.

Namespace

Drupal\text_with_title\Plugin\Field\FieldFormatter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $element['tabs_width'] = [
    '#title' => $this
      ->t('Tabs Width'),
    '#type' => 'select',
    '#options' => [
      '1' => '1 Column',
      '2' => '2 Column',
      '3' => '3 Column',
      '4' => '4 Column',
      '5' => '5 Column',
      '6' => '6 Column',
      '7' => '7 Column',
      '8' => '8 Column',
      '9' => '9 Column',
      '10' => '10 Column',
      '11' => '11 Column',
      '12' => '12 Column',
    ],
    '#default_value' => $this
      ->getSetting('tabs_width'),
  ];
  return $element;
}