You are here

public function AddForm::validateForm in Linkit 8.5

Same name and namespace in other branches
  1. 8.4 src/Form/Matcher/AddForm.php \Drupal\linkit\Form\Matcher\AddForm::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

src/Form/Matcher/AddForm.php, line 92

Class

AddForm
Provides a form to apply matchers to a profile.

Namespace

Drupal\linkit\Form\Matcher

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (empty($form_state
    ->getValue('plugin'))) {
    $form_state
      ->setErrorByName('plugin', $this
      ->t('No matcher selected.'));
  }
}