function FormTestHooks::formAlter

Implements hook_form_alter().

File

core/modules/system/tests/modules/form_test/src/Hook/FormTestHooks.php, line 26

Class

FormTestHooks
Hook implementations for form_test.

Namespace

Drupal\form_test\Hook

Code

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.