function FormTestLimitValidationErrorsForm::elementValidateLimitValidationErrors
Same name in other branches
- 8.9.x core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php \Drupal\form_test\Form\FormTestLimitValidationErrorsForm::elementValidateLimitValidationErrors()
- 10 core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php \Drupal\form_test\Form\FormTestLimitValidationErrorsForm::elementValidateLimitValidationErrors()
- 11.x core/modules/system/tests/modules/form_test/src/Form/FormTestLimitValidationErrorsForm.php \Drupal\form_test\Form\FormTestLimitValidationErrorsForm::elementValidateLimitValidationErrors()
File
-
core/
modules/ system/ tests/ modules/ form_test/ src/ Form/ FormTestLimitValidationErrorsForm.php, line 88
Class
- FormTestLimitValidationErrorsForm
- Builds a simple form with a button triggering partial validation.
Namespace
Drupal\form_test\FormCode
public function elementValidateLimitValidationErrors($element, FormStateInterface $form_state) {
if ($element['#value'] == 'invalid') {
$form_state->setError($element, t('@label element is invalid', [
'@label' => $element['#title'],
]));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.