Created
November 30, 2017 07:29
-
-
Save cyberlex404/82b92c93f60380254c56a48a25c4a43f to your computer and use it in GitHub Desktop.
MODULE_form_user_login_form_alter
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 | |
| use Drupal\Core\Form\FormStateInterface; | |
| use Drupal\Core\Url; | |
| use Drupal\Component\Render\FormattableMarkup; | |
| /** | |
| * Implements hook_form_BASE_FORM_ID_alter(). | |
| */ | |
| function MODULE_form_user_login_form_alter(&$form, FormStateInterface $form_state, $form_id) { | |
| $url = Url::fromRoute('user.register'); | |
| $form['register_link'] = [ | |
| '#markup' => new FormattableMarkup('@question <a href="@link">@link_text</a>', [ | |
| '@question' => t('No account?'), | |
| '@link' => $url->toString(), | |
| '@link_text' => t('registration'), | |
| ]) | |
| ]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment