title: how can I add modal to navbar in yii2 using yii2 -bootstrap extension?
body: <p>I'm trying to put modal in a navbar in my yii2 project. I'm using yii2-bootstrap extension. </p>
  
  <p><strong>Code for my nav:</strong></p>
  
  <pre><code>        NavBar::begin([
              'brandLabel' =&gt; 'My Company',
              'brandUrl' =&gt; Yii::$app-&gt;homeUrl,
              'options' =&gt; [
                  'class' =&gt; 'navbar-inverse navbar-fixed-top',
              ],
          ]);
          $menuItems = [
              ['label' =&gt; 'Home', 'url' =&gt; ['/site/index']],
              //['label' =&gt; 'facilities', 'url' =&gt; ['/facilities/index']],
  
          ['label' =&gt; 'Hotel',
          'items' =&gt; [
               ['label' =&gt; 'Facilities', 'url' =&gt; ['/facilities/index']],
             //  '&lt;li class="divider"&gt;&lt;/li&gt;',
           //    '&lt;li class="dropdown-header"&gt;Dropdown Header&lt;/li&gt;',
               ['label' =&gt; 'Cuisines', 'url' =&gt; ['/cuisines/index']],
          ],
  
           ]
          ];
  
          if (Yii::$app-&gt;user-&gt;isGuest) {
              $menuItems[] = ['label' =&gt; 'Login', 'url' =&gt; ['/site/login']];
          } else {
              $menuItems[] = [
                  'label' =&gt; 'Logout (' . Yii::$app-&gt;user-&gt;identity-&gt;username . ')',
                  'url' =&gt; ['/site/logout'],
                  'linkOptions' =&gt; ['data-method' =&gt; 'post']
              ];
          }
          echo Nav::widget([
              'options' =&gt; ['class' =&gt; 'navbar-nav navbar-right'],
              'items' =&gt; $menuItems,
          ]);
  
          NavBar::end();
  
  
      ?&gt;
  </code></pre>
  
  <p><strong>code for modal:</strong></p>
  
  <pre><code>&lt;?php
  
  Modal::begin([
      'header' =&gt; '&lt;h2&gt;Hello world&lt;/h2&gt;',
      'toggleButton' =&gt; ['label' =&gt; 'click me'],
   ]);
  
   echo 'Say hello...';
  
   Modal::end();
  ?&gt;
  </code></pre>
  
  <p>can anyone please tell me how to add this modal to navbar?</p>