Skip to content

Instantly share code, notes, and snippets.

@otarza
Created March 2, 2016 10:42
Show Gist options
  • Save otarza/46d6bd175cdab8036f7f to your computer and use it in GitHub Desktop.
Save otarza/46d6bd175cdab8036f7f to your computer and use it in GitHub Desktop.
Render drupal 8 register form
<?php
$entity = \Drupal::entityTypeManager()->getStorage('user')->create(array());
$formObject = \Drupal::entityTypeManager()
->getFormObject('user', 'register')
->setEntity($entity);
$form = \Drupal::formBuilder()->getForm($formObject);
print \Drupal::service('renderer')->render($form);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment