function WizardTest::stepOneValidate

Same name in other branches
  1. 8.x-3.x tests/modules/ctools_wizard_test/src/Wizard/WizardTest.php \Drupal\ctools_wizard_test\Wizard\WizardTest::stepOneValidate()

Validation callback for the first step.

File

tests/modules/ctools_wizard_test/src/Wizard/WizardTest.php, line 50

Class

WizardTest

Namespace

Drupal\ctools_wizard_test\Wizard

Code

public function stepOneValidate($form, FormStateInterface $form_state) {
    if ($form_state->getValue('one') == 'wrong') {
        $form_state->setErrorByName('one', $this->t('Cannot set the value to "wrong".'));
    }
}