function FormValidator::finalizeValidation

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Form/FormValidator.php \Drupal\Core\Form\FormValidator::finalizeValidation()
  2. 8.9.x core/lib/Drupal/Core/Form/FormValidator.php \Drupal\Core\Form\FormValidator::finalizeValidation()
  3. 10 core/lib/Drupal/Core/Form/FormValidator.php \Drupal\Core\Form\FormValidator::finalizeValidation()

Finalizes validation.

Parameters

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

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

string $form_id: The unique string identifying the form.

1 call to FormValidator::finalizeValidation()
FormValidator::validateForm in core/lib/Drupal/Core/Form/FormValidator.php
Validates user-submitted form data in the $form_state.

File

core/lib/Drupal/Core/Form/FormValidator.php, line 197

Class

FormValidator
Provides validation of form submissions.

Namespace

Drupal\Core\Form

Code

protected function finalizeValidation(&$form, FormStateInterface &$form_state, $form_id) {
    // Delegate handling of form errors to a service.
    $this->formErrorHandler
        ->handleFormErrors($form, $form_state);
    // Mark this form as validated.
    $form_state->setValidationComplete();
}

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