You are here

public function ExposedFormPluginBase::exposedFormSubmit in Drupal 10

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

Submits the exposed form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

array $exclude: Array of keys that will not appear in $view->exposed_raw_input; for example, 'form_build_id'.

Overrides ExposedFormPluginInterface::exposedFormSubmit

See also

\Drupal\views\Form\ViewsExposedForm::submitForm()

File

core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php, line 309

Class

ExposedFormPluginBase
Base class for Views exposed filter form plugins.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

public function exposedFormSubmit(&$form, FormStateInterface $form_state, &$exclude) {
  if (!$form_state
    ->isValueEmpty('op') && $form_state
    ->getValue('op') == $this->options['reset_button_label']) {
    $this
      ->resetForm($form, $form_state);
  }
  if ($pager_plugin = $form_state
    ->get('pager_plugin')) {
    $pager_plugin
      ->exposedFormSubmit($form, $form_state, $exclude);
    $exclude[] = 'pager_plugin';
  }
}