public function ViewsTestDataErrorForm::validateForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataErrorForm.php \Drupal\views_test_data\Form\ViewsTestDataErrorForm::validateForm()
- 9 core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataErrorForm.php \Drupal\views_test_data\Form\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'));
}