function ViewsTestDataErrorForm::validateForm

Same name and namespace in other branches
  1. 9 core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataErrorForm.php \Drupal\views_test_data\Form\ViewsTestDataErrorForm::validateForm()
  2. 8.9.x core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataErrorForm.php \Drupal\views_test_data\Form\ViewsTestDataErrorForm::validateForm()
  3. 10 core/modules/views/tests/modules/views_test_data/src/Form/ViewsTestDataErrorForm.php \Drupal\views_test_data\Form\ViewsTestDataErrorForm::validateForm()

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\Form

Code

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.