d3d58563da7f011934f08e5be7bf4d7e6aca1d20
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / form_BASE_FORM_ID_alter.twig
1 /**
2  * Implements hook_form_BASE_FORM_ID_alter().
3  */
4 function {{ machine_name }}_form_BASE_FORM_ID_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
5   // Modification for the form with the given BASE_FORM_ID goes here. For
6   // example, if BASE_FORM_ID is "node_form", this code would run on every
7   // node form, regardless of node type.
8
9   // Add a checkbox to the node 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 }