Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EntityReference.php

function EntityReference::buildOptionsForm

Same name in this branch
  1. 11.1.x core/modules/views/src/Plugin/views/row/EntityReference.php \Drupal\views\Plugin\views\row\EntityReference::buildOptionsForm()

Overrides StylePluginBase::buildOptionsForm

File

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

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,
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal