Created
July 20, 2017 14:39
-
-
Save kedramon/9d594aabfe37d2d7a1a906210c03bf87 to your computer and use it in GitHub Desktop.
Redirect user after register form submit to internal page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_form_BASE_FORM_ID_alter(). | |
*/ | |
function ns_user_form_user_register_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
$form['actions']['submit']['#value'] = t('Send'); | |
$form['#attached']['library'][] = 'core/jquery.ui.tooltip'; | |
$form['#attached']['library'][] = 'nedapsecurity/tooltips'; | |
$form['actions']['submit']['#submit'][] = 'ns_user_register_submit_handler'; | |
} | |
/** | |
* Custom submit handler. | |
*/ | |
function ns_user_register_submit_handler(&$form, FormStateInterface $form_state) { | |
$url = Url::fromUri('internal:/thank-you'); | |
$form_state->setRedirectUrl($url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment