function BooleanCheckboxWidget::settingsForm

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\BooleanCheckboxWidget::settingsForm()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\BooleanCheckboxWidget::settingsForm()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\BooleanCheckboxWidget::settingsForm()

Overrides WidgetBase::settingsForm

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php, line 35

Class

BooleanCheckboxWidget
Plugin implementation of the 'boolean_checkbox' widget.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

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

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