public function AddForm::validateForm in Linkit 8.4
Same name in this branch
- 8.4 src/Form/Attribute/AddForm.php \Drupal\linkit\Form\Attribute\AddForm::validateForm()
- 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/ Attribute/ AddForm.php, line 97 - Contains \Drupal\linkit\Form\Attribute\AddForm.
Class
- AddForm
- Provides a form to apply attributes to a profile.
Namespace
Drupal\linkit\Form\AttributeCode
public function validateForm(array &$form, FormStateInterface $form_state) {
if (empty($form_state
->getValue('plugin'))) {
$form_state
->setErrorByName('plugin', $this
->t('No attribute selected.'));
}
}