You are here

protected function Search::operatorForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/search/src/Plugin/views/filter/Search.php \Drupal\search\Plugin\views\filter\Search::operatorForm()

Options form subform for setting the operator.

This may be overridden by child classes, and it must define $form['operator'];

Overrides FilterPluginBase::operatorForm

See also

buildOptionsForm()

File

core/modules/search/src/Plugin/views/filter/Search.php, line 73

Class

Search
Filter handler for search keywords.

Namespace

Drupal\search\Plugin\views\filter

Code

protected function operatorForm(&$form, FormStateInterface $form_state) {
  $form['operator'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('On empty input'),
    '#default_value' => $this->operator,
    '#options' => [
      'optional' => $this
        ->t('Show All'),
      'required' => $this
        ->t('Show None'),
    ],
  ];
}