function OptionsTestHooks::formEntityTestEntityTestFormAlter

Implements hook_form_FORM_ID_alter().

File

core/modules/options/tests/options_test/src/Hook/OptionsTestHooks.php, line 18

Class

OptionsTestHooks
Hook implementations for options_test.

Namespace

Drupal\options_test\Hook

Code

public function formEntityTestEntityTestFormAlter(&$form, FormStateInterface $form_state, $form_id) : void {
    if (\Drupal::state()->get('options_test.form_alter_enable', FALSE)) {
        $form['card_1']['widget']['#required_error'] = t('This is custom message for required field.');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.