title: Symfony 4: redirect with post parameters when unsuccessful registration
body: <p>I have to maintain one project in <code>Symfony 4</code>. Unfortunately I am new to symfony and moreover it seems for me that given project has some mess in it. 
  The problem is that after unsuccessful registration form fields are not filled in and become empty.</p>
  
  <p>So</p>
  
  <p>1) I have <code>AccountrController.php</code> with two methods
  2) I have <code>registerPage</code> that simply renders twig template (with form).</p>
  
  <pre><code>public function registerPage()
  {
      return $this-&gt;render("@Frontend/register.html.twig");
  }
  </code></pre>
  
  <p>3) I have registerAction. To this action form data are posted.</p>
  
  <pre><code>public function registerAction()
  {
       ... $this-&gt;post["username"] ...
  </code></pre>
  
  <p>4) When register fails for some validation reasons it redirects back to <code>registerPage</code> like this:</p>
  
  <pre><code>return $this-&gt;redirect($this-&gt;referer);
  </code></pre>
  
  <p>5) And as a note <code>formbuilder</code> is not used here. Form is build in html / twig . </p>
  
  <p>The problem is that when registration fails, error message appears (via <code>flashbag</code>), but already filled in fields are empty. Because redirect is <code>GET</code> page and <code>POST</code> parameters are not passed in. How to fix it better and faster? </p>