473f3db629f9fb0923c6c4c4a23cb44c56a4d286
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / form_FORM_ID_alter.twig
1 /**
2  * Implements hook_form_FORM_ID_alter().
3  */
4 function {{ machine_name }}_form_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
5   // Modification for the form with the given form ID goes here. For example, if
6   // FORM_ID is "user_register_form" this code would run only on the user
7   // registration form.
8
9   // Add a checkbox to registration form about agreeing to terms of use.
10   $form['terms_of_use'] = [
11     '#type' => 'checkbox',
12     '#title' => t("I agree with the website's terms and conditions."),
13     '#required' => TRUE,
14   ];
15 }