function NodeTestHooks::formAlter
Implements hook_form_alter().
File
-
core/
modules/ node/ tests/ modules/ node_test/ src/ Hook/ NodeTestHooks.php, line 196
Class
- NodeTestHooks
- Hook implementations for node_test.
Namespace
Drupal\node_test\HookCode
public function formAlter(&$form, FormStateInterface $form_state, $form_id) : void {
if (!$form_state->get('node_test_form_alter')) {
\Drupal::messenger()->addStatus('Storage is not set');
$form_state->set('node_test_form_alter', TRUE);
}
else {
\Drupal::messenger()->addStatus('Storage is set');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.