You are here

public function StringFilter::buildExposeForm in Drupal 8

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

Options form subform for exposed filter options.

Overrides FilterPluginBase::buildExposeForm

See also

buildOptionsForm()

File

core/modules/views/src/Plugin/views/filter/StringFilter.php, line 84

Class

StringFilter
Basic textfield filter to handle string filtering commands including equality, like, not like, etc.

Namespace

Drupal\views\Plugin\views\filter

Code

public function buildExposeForm(&$form, FormStateInterface $form_state) {
  parent::buildExposeForm($form, $form_state);
  $form['expose']['placeholder'] = [
    '#type' => 'textfield',
    '#default_value' => $this->options['expose']['placeholder'],
    '#title' => $this
      ->t('Placeholder'),
    '#size' => 40,
    '#description' => $this
      ->t('Hint text that appears inside the field when empty.'),
  ];
}