function entity_test_form_entity_test_form_alter in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_form_entity_test_form_alter()
Implements hook_form_BASE_FORM_ID_alter().
File
- core/
modules/ system/ tests/ modules/ entity_test/ entity_test.module, line 273 - Test module for the entity API providing several entity types for testing.
Code
function entity_test_form_entity_test_form_alter(&$form) {
switch (\Drupal::state()
->get('entity_test.form.validate.test')) {
case 'form-level':
$form['#validate'][] = 'entity_test_form_entity_test_form_validate';
$form['#validate'][] = 'entity_test_form_entity_test_form_validate_check';
break;
case 'button-level':
$form['actions']['submit']['#validate'][] = 'entity_test_form_entity_test_form_validate';
}
}