I would like to call the user login form in my theme but I can't.
In Drupal 7 I did this.
$elements = drupal_get_form("user_login");
$form = drupal_render($elements);
echo utf8_decode($form);
How I can do this with Drupal 8?
I tried this.
Drupal::formBuilder()->getForm(Drupal\user\Form\UserLoginForm::class)
How do I render this?
With the following code, I can show the login form, but I can't log in with it. What should I add to make it work?
$form = Drupal::formBuilder()->getForm(Drupal\user\Form\UserLoginForm::class) ;
$render = Drupal::service('renderer');
$render->renderPlain($form);
drupal_render
is still available in Drupal 8, you should use that – Clive♦ Jan 7 '16 at 14:28