public function OnOffWidget::settingsForm

Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().

Overrides WidgetBase::settingsForm

File

drupal/core/modules/options/lib/Drupal/options/Plugin/field/widget/OnOffWidget.php, line 34
Contains \Drupal\options\Plugin\field\widget\OnOffWidget.

Class

OnOffWidget
Plugin implementation of the 'options_onoff' widget.

Namespace

Drupal\options\Plugin\field\widget

Code

public function settingsForm(array $form, array &$form_state) {
  $element['display_label'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use field label instead of the "On value" as label'),
    '#default_value' => $this
      ->getSetting('display_label'),
    '#weight' => -1,
  );
  return $element;
}