Access / Alter user registration form submit button in $form variable In drupal 8, I have created a custom module to alter the user login and register forms in 2 class that extends UserLoginForm and RegisterForm respectively.

Whereas for the login form I can add some link in the $form['action'] array or add a class to the submit button:

 $form['actions']['submit']['#attributes'] = [
    'class' =&gt; ['btn', 'btn-primary'],
 ];


a contrario, there is no action array in user register $form variable(!)

So how can I access in my class the submit button, and more generally, the action array?
While UserLoginForm is a regular form based on form api, RegisterForm is an entity form, where the actions are defined in a separate method EntityForm::actions(), which is overridden in RegisterForm:

  protected function actions(array $form, FormStateInterface $form_state) {
    $element = parent::actions($form, $form_state);
    $element['submit']['#value'] = $this-&gt;t('Create new account');
    return $element;
  }


which you can override again in your extended class.