Created
September 9, 2017 16:15
-
-
Save clrockwell/ca32d4c82b721a1078acd95a6fde01df to your computer and use it in GitHub Desktop.
Drupal 8: altering a @FormElement - update password_confirm element to require 6 characters
This file contains hidden or 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
<?php | |
/** | |
* Implements hook_element_info_alter(). | |
*/ | |
function scholarrx_user_registration_element_info_alter(array &$info) { | |
$info['password_confirm']['#process'][] = 'scholarrx_process_password_confirm'; | |
} | |
function scholarrx_process_password_confirm(&$element, FormStateInterface $form_state, &$complete_form) { | |
$element['pass1']['#attributes']['minlength'] = 6; | |
return $element; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment