You are here

public function TaxonomyIndexTid::buildExposeForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::buildExposeForm()

Options form subform for exposed filter options.

Overrides InOperator::buildExposeForm

See also

buildOptionsForm()

File

core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php, line 370

Class

TaxonomyIndexTid
Filter by term id.

Namespace

Drupal\taxonomy\Plugin\views\filter

Code

public function buildExposeForm(&$form, FormStateInterface $form_state) {
  parent::buildExposeForm($form, $form_state);
  if ($this->options['type'] != 'select') {
    unset($form['expose']['reduce']);
  }
  $form['error_message'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Display error message'),
    '#default_value' => !empty($this->options['error_message']),
  ];
}