How to use 2 form tag in same page in Yii
<p>In frontend  of Yii , 
   I have 2 form    :
            1 Login Form
            2 Signup 
   my signup form is working , but when login is not working  , 
     i found a error
     Call to a member function formName() on null</p>

<p><strong>//Form Code</strong></p>

<pre><code>&lt;!-------signup----------&gt;
&lt;h1&gt;Signup  Form&lt;/h1&gt;
&lt;?php $form = ActiveForm::begin(['id' =&gt; 'form-signup', 'action' =&gt; Url::to(['site/signup'])]); ?&gt;
    &lt;?= $form-&gt;field($modelSignup, 'username')-&gt;textInput(['autofocus' =&gt; true]) ?&gt;
    &lt;?= $form-&gt;field($modelSignup, 'email') ?&gt;
    &lt;?= $form-&gt;field($modelSignup, 'password')-&gt;passwordInput() ?&gt;
    &lt;?= Html::submitButton('Signup', ['class' =&gt; 'btn btn-primary', 'name' =&gt; 'signup-button']) ?&gt;
&lt;?php ActiveForm::end(); ?&gt;
&lt;!-------// signup----------&gt;

&lt;!-------login----------&gt;
&lt;h1&gt;Login  Form&lt;/h1&gt;
&lt;?php $form = ActiveForm::begin(['id' =&gt; 'form-login', 'action' =&gt; Url::to(['site/login'])]); ?&gt;
    &lt;?= $form-&gt;field($modelLogin, 'username')-&gt;textInput(['autofocus' =&gt; true]) ?&gt;
    &lt;?= $form-&gt;field($modelLogin, 'email') ?&gt;
    &lt;?= $form-&gt;field($modelLogin, 'password')-&gt;passwordInput() ?&gt;
    &lt;?= Html::submitButton('Login', ['class' =&gt; 'btn btn-primary', 'name' =&gt; 'login-button']) ?&gt;
&lt;?php ActiveForm::end(); ?&gt;
&lt;!-------//login----------&gt;
</code></pre>