function LanguageFormatter::settingsForm

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

Overrides StringFormatter::settingsForm

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php, line 91

Class

LanguageFormatter
Plugin implementation of the 'language' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
    $form = parent::settingsForm($form, $form_state);
    $form['native_language'] = [
        '#title' => $this->t('Display in native language'),
        '#type' => 'checkbox',
        '#default_value' => $this->getSetting('native_language'),
    ];
    return $form;
}

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