You are here

public function ViewsExposedForm::validateForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Form/ViewsExposedForm.php \Drupal\views\Form\ViewsExposedForm::validateForm()

Form validation handler.

Parameters

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

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

Overrides FormBase::validateForm

File

core/modules/views/src/Form/ViewsExposedForm.php, line 135
Contains \Drupal\views\Form\ViewsExposedForm.

Class

ViewsExposedForm
Provides the views exposed form.

Namespace

Drupal\views\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $view = $form_state
    ->get('view');
  foreach (array(
    'field',
    'filter',
  ) as $type) {

    /** @var \Drupal\views\Plugin\views\ViewsHandlerInterface[] $handlers */
    $handlers =& $view->{$type};
    foreach ($handlers as $key => $handler) {
      $handlers[$key]
        ->validateExposed($form, $form_state);
    }
  }

  /** @var \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase $exposed_form_plugin */
  $exposed_form_plugin = $view->display_handler
    ->getPlugin('exposed_form');
  $exposed_form_plugin
    ->exposedFormValidate($form, $form_state);
}