You are here

public function DomainAliasForm::validateForm in Domain Access 8

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

domain_alias/src/DomainAliasForm.php, line 208

Class

DomainAliasForm
Base form controller for domain alias edit forms.

Namespace

Drupal\domain_alias

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $errors = $this->validator
    ->validate($this->entity);
  if (!empty($errors)) {
    $form_state
      ->setErrorByName('pattern', $errors);
  }
}