Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function validateForm(array &$form, FormStateInterface $form_state) {
- $values = $form_state->getValues();
- if ($values['my_field'] == 'some_forbidden_value') {
- $form_state->setErrorByName('my_field', $this->t('This value is forbidden!'));
- }
- }
Add Comment
Please, Sign In to add comment