function field_test_field_widget_form_alter
Same name in other branches
- 7.x modules/field/tests/field_test.module \field_test_field_widget_form_alter()
Implements hook_field_widget_form_alter().
File
-
core/
modules/ field/ tests/ modules/ field_test/ field_test.module, line 104
Code
function field_test_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) {
// Set a message if this is for the form displayed to set default value for
// the field.
if ($context['default']) {
\Drupal::messenger()->addStatus('From hook_field_widget_form_alter(): Default form is true.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.