You are here

public function EntityReferenceFilterViewResult::buildExposeForm in Views Reference Filter 8

Options form subform for exposed filter options.

Overrides InOperator::buildExposeForm

See also

buildOptionsForm()

File

src/Plugin/views/filter/EntityReferenceFilterViewResult.php, line 169

Class

EntityReferenceFilterViewResult
Filter by entity id using items got from the another view..

Namespace

Drupal\entityreference_filter\Plugin\views\filter

Code

public function buildExposeForm(&$form, FormStateInterface $form_state) {
  parent::buildExposeForm($form, $form_state);
  $form['hide_empty_filter'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Hide empty filter'),
    '#description' => $this
      ->t('Hide the exposed widget if the entity list is empty.'),
    '#default_value' => $this->options['hide_empty_filter'],
  ];

  // Hide useless field.
  $form['expose']['reduce']['#access'] = FALSE;
}