On a custom page I'm trying to load an user edit form with a specific form display. I'm able to load the form however I can't figure out how to load the form with the specific display.
This is what I have now:
public function content($substep) {
$user = \Drupal::entityTypeManager()
->getStorage('user')
->load(1); // loading user 1 for test purpose
$form_state = new FormState();
$form = \Drupal::entityTypeManager()
->getFormObject('user', 'default')
->setEntity($user);
return \Drupal::formBuilder()->getForm($form);
}
Anyone has an idea?