title: Yii2: Method Not Allowed (#405) while logout user
body: <p>I am loging out user through following code. This is my view code behind logout button:</p>
  
  <pre><code>&lt;li&gt;
     &lt;a href="&lt;?= Url::to(['site/logout'])?&gt;"&gt;
      &lt;i class="fa fa-sign-out"&gt;&lt;/i&gt; Log out
     &lt;/a&gt;
   &lt;/li&gt;
  </code></pre>
  
  <p>My controller code is:</p>
  
  <pre><code>public function actionLogout()
  {
      Yii::$app-&gt;user-&gt;logout();
  
      $model = new LoginForm();
      $this-&gt;layout = 'index';
      return $this-&gt;render('login', ['model' =&gt; $model]);
  }
  </code></pre>
  
  <p>In the logout it shows me:</p>
  
  <blockquote>
    <p>Method Not Allowed. This url can only handle the following request
    methods: POST.</p>
  </blockquote>
  
  <p>What is it?</p>