You are here

public function InputRequired::buildOptionsForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::buildOptionsForm()
  2. 9 core/modules/views/src/Plugin/views/exposed_form/InputRequired.php \Drupal\views\Plugin\views\exposed_form\InputRequired::buildOptionsForm()

Provide a form to edit options for this plugin.

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' => $this->options['text_input_required_format'] ?? filter_default_format(),
    '#editor' => FALSE,
  ];
}