public function EntityReference::buildOptionsForm

Same name in this branch
  1. 8.x drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/row/EntityReference.php \Drupal\entity_reference\Plugin\views\row\EntityReference::buildOptionsForm()
  2. 8.x drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php \Drupal\entity_reference\Plugin\views\style\EntityReference::buildOptionsForm()

Overrides \Drupal\views\Plugin\views\style\StylePluginBase\StylePluginBase::buildOptionsForm().

Overrides StylePluginBase::buildOptionsForm

File

drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/style/EntityReference.php, line 57
Contains \Drupal\entity_reference\Plugin\views\style\EntityReference.

Class

EntityReference
EntityReference style plugin.

Namespace

Drupal\entity_reference\Plugin\views\style

Code

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