function EntityReferenceLabelFormatter::settingsForm

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

Overrides FormatterBase::settingsForm

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php, line 36

Class

EntityReferenceLabelFormatter
Plugin implementation of the 'entity reference label' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
    $elements['link'] = [
        '#title' => t('Link label to the referenced entity'),
        '#type' => 'checkbox',
        '#default_value' => $this->getSetting('link'),
    ];
    return $elements;
}

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