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() {
// Build action links.
$items = array();
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(
'attributes' => array(
'title' => $this->t('Create a new user account.'),
'class' => array('create-account-link'),
),
)));
$items['create_account'] = [
'#type' => 'link',
'#title' => $this->t('Create new account'),
'#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(
'attributes' => array(
'title' => $this->t('Send password reset instructions via email.'),
'class' => array('request-password-link'),
),
)));
$items['request_password'] = [
'#type' => 'link',
'#title' => $this->t('Reset your password'),
'#url' => Url::fromRoute('user.pass', [], [
'attributes' => [
'title' => $this->t('Send password reset instructions via email.'),
'class' => ['request-password-link'],
],
]),
];
return array(
'user_login_form' => $form,
'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