function TaxonomyIndexTid::buildExposeForm

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()
  2. 8.9.x core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::buildExposeForm()
  3. 10 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::buildExposeForm()

Overrides InOperator::buildExposeForm

File

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

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

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