function EntityReference::buildOptionsForm

Same name in this branch
  1. 9 core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::buildOptionsForm()
Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::buildOptionsForm()
  2. 8.9.x core/modules/views/src/Plugin/views/style/EntityReference.php \Drupal\views\Plugin\views\style\EntityReference::buildOptionsForm()
  3. 10 core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::buildOptionsForm()
  4. 10 core/modules/views/src/Plugin/views/style/EntityReference.php \Drupal\views\Plugin\views\style\EntityReference::buildOptionsForm()
  5. 11.x core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::buildOptionsForm()
  6. 11.x core/modules/views/src/Plugin/views/style/EntityReference.php \Drupal\views\Plugin\views\style\EntityReference::buildOptionsForm()

Overrides StylePluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/style/EntityReference.php, line 52

Class

EntityReference
EntityReference style plugin.

Namespace

Drupal\views\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $options = $this->displayHandler
        ->getFieldLabels(TRUE);
    $form['search_fields'] = [
        '#type' => 'checkboxes',
        '#title' => $this->t('Search fields'),
        '#options' => $options,
        '#required' => TRUE,
        '#default_value' => $this->options['search_fields'],
        '#description' => $this->t('Select the field(s) that will be searched when using the autocomplete widget.'),
        '#weight' => -3,
    ];
}

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