Commit 7ee29979 authored by alexpott's avatar alexpott

Issue #2809333 by andypost: Use build array for user login block links

parent d9636476
...@@ -98,19 +98,27 @@ public function build() { ...@@ -98,19 +98,27 @@ public function build() {
// Build action links. // Build action links.
$items = array(); $items = array();
if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) { if (\Drupal::config('user.settings')->get('register') != USER_REGISTER_ADMINISTRATORS_ONLY) {
$items['create_account'] = \Drupal::l($this->t('Create new account'), new Url('user.register', array(), array( $items['create_account'] = [
'attributes' => array( '#type' => 'link',
'title' => $this->t('Create a new user account.'), '#title' => $this->t('Create new account'),
'class' => array('create-account-link'), '#url' => Url::fromRoute('user.register', [], [
), 'attributes' => [
))); 'title' => $this->t('Create a new user account.'),
'class' => ['create-account-link'],
],
]),
];
} }
$items['request_password'] = \Drupal::l($this->t('Reset your password'), new Url('user.pass', array(), array( $items['request_password'] = [
'attributes' => array( '#type' => 'link',
'title' => $this->t('Send password reset instructions via email.'), '#title' => $this->t('Reset your password'),
'class' => array('request-password-link'), '#url' => Url::fromRoute('user.pass', [], [
), 'attributes' => [
))); 'title' => $this->t('Send password reset instructions via email.'),
'class' => ['request-password-link'],
],
]),
];
return array( return array(
'user_login_form' => $form, 'user_login_form' => $form,
'user_links' => array( 'user_links' => array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment