title: Yii2 Link FrontEnd To BackEnd
body: <p>How to link from frontend page to backend in Yii2 using advanced template.... I want to link the login button from frondend to backend...when I click on login button in frontend it can redirect to login page in backend that I already created...</p>
  
  <pre><code>&lt;div class="wrap"&gt;
      &lt;?php
          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; 'About', 'url' =&gt; ['/site/about']],
                  ['label' =&gt; 'Contact', 'url' =&gt; ['/site/contact']],
          ];
          if (Yii::$app-&gt;user-&gt;isGuest) {
              $menuItems[] = ['label' =&gt; 'Signup', 'url' =&gt; ['/site/signup']];
              $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;
  
      &lt;div class="container"&gt;
          &lt;?= Breadcrumbs::widget([
              'links' =&gt; isset($this-&gt;params['breadcrumbs']) ? $this-&gt;params['breadcrumbs'] : [],
          ]) ?&gt;
          &lt;?= Alert::widget() ?&gt;
          &lt;?= $content ?&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>`</p>