function FormTestHooks::formAlter
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/form_test/src/Hook/FormTestHooks.php \Drupal\form_test\Hook\FormTestHooks::formAlter()
Implements hook_form_alter().
Attributes
#[Hook('form_alter')]
File
-
core/
modules/ system/ tests/ modules/ form_test/ src/ Hook/ FormTestHooks.php, line 30
Class
- FormTestHooks
- Hook implementations for form_test.
Namespace
Drupal\form_test\HookCode
public function formAlter(&$form, FormStateInterface $form_state, $form_id) : void {
if ($form_id == 'form_test_alter_form') {
\Drupal::messenger()->addStatus('form_test_form_alter() executed.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.