Silex double form <p>I'm currently using Silex2 FormFactory to build a form and I stumbled on a problem.</p> <p>I have a login page (login.twig), asking for email and a password. This form includes the validation. But I want to have this login form always in my header too (on my layout.twig ). I created the form and linked the action to the location of the login page. I had to manualy write the correct id and name of each input element, and I copied the generated token of the login.twig inside the form. But I doubt this is the correct way to do it?</p> <pre><code>&lt;form class="navbar-form pull-right" action="{{ path('auth.login') }}" method="post" novalidate="novalidate"&gt;{# disables HTML5 formchecking #} &lt;input class="span2" type="text" id="loginform_email" name="loginform[email]" placeholder="Email"&gt; &lt;input class="span2" type="password" id="loginform_password" name="loginform[password]" placeholder="Password"&gt; &lt;input id="loginform__token" type="hidden" value="9eb2a291d32d114987aee1548da878201dd79a7b" name="loginform[_token]"&gt; &lt;button class="btn" type="submit"&gt;Sign in&lt;/button&gt; &lt;a href="{{ path('auth.register') }}"&gt;register here&lt;/a&gt; &lt;/form&gt; </code></pre>