Skip to content

Instantly share code, notes, and snippets.

@voidberg
Created December 9, 2015 11:02
Show Gist options
  • Select an option

  • Save voidberg/34c35af74e39f79ca5a0 to your computer and use it in GitHub Desktop.

Select an option

Save voidberg/34c35af74e39f79ca5a0 to your computer and use it in GitHub Desktop.
Displaying entity forms in Drupal 8
<p>Please login</p>
{{ login_form }}
// We do this in the page preprocess function so
// that we can access the variables from page.html.twig.
function theme_preprocess_page(&$variables) {
$form = \Drupal::formBuilder()->getForm('Drupal\user\Form\UserLoginForm');
$variables['login_form'] = $form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment