title: Symfony 3, login form created in login controller
body: <p>I would like create login form in symfony with in controller. Something like this.</p>
  
  <pre><code>/**
   * @Route("/login", name="login_controller")
   */
  public function loginAction(Request $request, AuthenticationUtils $authenticationUtils) {
  
      $error = $authenticationUtils-&gt;getLastAuthenticationError();
  
      $lastUsername = $authenticationUtils-&gt;getLastUsername();
  
      $form = $this-&gt;createFormBuilder(new User)
              -&gt;add('username', TextType::class, array(
                  'attr' =&gt; array(
                      'name' =&gt; '_username'
                  )
              ))
              -&gt;add('password', PasswordType::class, array(
                  'attr' =&gt; array(
                      'name' =&gt; '_password'
                  )
              ))
              -&gt;add('login', ButtonType::class)
              -&gt;add('logout', ButtonType::class)
              -&gt;getForm();
  
      return $this-&gt;render('login/login.html.twig', array(
          'error' =&gt; $error,
          'lastUsername' =&gt; $lastUsername,
          'form' =&gt; $form-&gt;createView()
      ));
  }
  </code></pre>
  
  <p>and twig</p>
  
  <pre><code>{{ form_start(form) }}
  {{ form_widget(form) }}
  {{ form_end(form) }}
  </code></pre>
  
  <p>After press login button nothig happens... But if I use instead of in twig </p>
  
  <pre><code>&lt;form action="{{ path('login_controller') }}" method="POST"&gt;
  
      &lt;label for="username"&gt;username:&lt;/label&gt;
      &lt;input type="text" name="_username" id="username" value="{{ lastUsername }}" /&gt;
  
      &lt;br /&gt;
  
      &lt;label for="password"&gt;password:&lt;/label&gt;
      &lt;input type="password" name="_password" id="password" /&gt;
  
      &lt;br /&gt;
  
      &lt;button type="submit"&gt;login&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;br /&gt;
  </code></pre>
  
  <p>All works well... Some idea pls?</p>