function InOperator::buildExposeForm

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::buildExposeForm()
  2. 8.9.x core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::buildExposeForm()
  3. 10 core/modules/views/src/Plugin/views/filter/InOperator.php \Drupal\views\Plugin\views\filter\InOperator::buildExposeForm()

Options form subform for exposed filter options.

Parameters

array $form: An alterable, associative array containing the structure of the form, passed by reference.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FilterPluginBase::buildExposeForm

1 call to InOperator::buildExposeForm()
TaxonomyIndexTid::buildExposeForm in core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
Options form subform for exposed filter options.
1 method overrides InOperator::buildExposeForm()
TaxonomyIndexTid::buildExposeForm in core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
Options form subform for exposed filter options.

File

core/modules/views/src/Plugin/views/filter/InOperator.php, line 100

Class

InOperator
Filter to handle matching of multiple options selectable via checkboxes.

Namespace

Drupal\views\Plugin\views\filter

Code

public function buildExposeForm(&$form, FormStateInterface $form_state) {
  parent::buildExposeForm($form, $form_state);
  $form['expose']['reduce'] = [
    '#type' => 'checkbox',
    '#title' => $this->t('Limit list to selected items'),
    '#description' => $this->t('If checked, the only items presented to the user will be the ones selected here.'),
    // Safety.
'#default_value' => !empty($this->options['expose']['reduce']),
  ];
}

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