You are here

function multiple_registration_form_user_register_form_alter in Multiple Registration 8

Same name and namespace in other branches
  1. 8.2 multiple_registration.module \multiple_registration_form_user_register_form_alter()
  2. 7 multiple_registration.module \multiple_registration_form_user_register_form_alter()
  3. 3.x multiple_registration.module \multiple_registration_form_user_register_form_alter()

Implements hook_form_FORM_ID_alter().

File

./multiple_registration.module, line 223
Contains multiple_registration.module.

Code

function multiple_registration_form_user_register_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $route_match = \Drupal::routeMatch();
  $route = $route_match
    ->getRouteName();
  if ($route == 'multiple_registration.role_registration_page') {
    $form['rid'] = [
      '#type' => 'value',
      '#value' => $route_match
        ->getParameter('rid'),
    ];
    $form['#validate'][] = 'multiple_registration_user_register_form_validate';
  }
}