Created
December 9, 2015 11:02
-
-
Save voidberg/34c35af74e39f79ca5a0 to your computer and use it in GitHub Desktop.
Displaying entity forms in Drupal 8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p>Please login</p> | |
| {{ login_form }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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