function ViewsTestDataErrorForm::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 FormInterface::validateForm
File
-
core/
modules/ views/ tests/ modules/ views_test_data/ src/ Form/ ViewsTestDataErrorForm.php, line 38
Class
- ViewsTestDataErrorForm
- Implements a test form that has a validation error.
Namespace
Drupal\views_test_data\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
$form_state->setErrorByName('text', t('Form validation error'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.