title: how can I add modal to navbar in yii2?
body: <p>I'm trying to add a modal to my navbar.<br>
  This is my \views\project_form.php:  </p>
  
  <pre><code>&lt;?php Modal::begin(['id' =&gt; 'modal', ?&gt;
  &lt;?= $form-&gt;field($model, 'Wert')-&gt;textInput(['maxlength' =&gt; true]) ?&gt;
  &lt;?php Modal::end(); ?&gt;
  </code></pre>
  
  <p>and this is my Controller:</p>
  
  <pre><code>function actionShowmodal(){
      $js='$("#modal").modal("show")';
      $this-&gt;getView()-&gt;registerJs($js);      
      return $this-&gt;render('create');
  }
  </code></pre>
  
  <p>I did this as it was described here <a href="https://stackoverflow.com/questions/22601352/how-can-i-add-modal-to-navbar-in-yii2-using-yii2-bootstrap-extension?rq=1">how can I add modal to navbar in yii2 using yii2 -bootstrap extension?</a>.<br>
  When I use a modal navbar in my index.php it works. But when I use a modal navbar in my form, an error is issued: Undefined variable: model.<br>
  How can I fix it?</p>