function InputRequired::buildOptionsForm

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::buildOptionsForm()
  2. 10 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::buildOptionsForm()
  3. 11.x core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::buildOptionsForm()

Overrides ExposedFormPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/exposed_form/InputRequired.php, line 29

Class

InputRequired
Exposed form plugin that provides an exposed form with required input.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $form['text_input_required'] = [
        '#type' => 'text_format',
        '#title' => $this->t('Text on demand'),
        '#description' => $this->t('Text to display instead of results until the user selects and applies an exposed filter.'),
        '#default_value' => $this->options['text_input_required'],
        '#format' => isset($this->options['text_input_required_format']) ? $this->options['text_input_required_format'] : filter_default_format(),
        '#editor' => FALSE,
    ];
}

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