Yii2: Method Not Allowed (#405) while logout user

前端 未结 7 1074
无人及你
无人及你 2020-12-16 03:02

I am loging out user through following code. This is my view code behind logout button:

  • \"&g
  • 7条回答
    •  北荒
      北荒 (楼主)
      2020-12-16 03:19

      If you are using Nav::widget to generate menus, the logout item should have linkOptions specified:

      [
        'label' => 'Logout',
        'url' => ['/logout'],
        'linkOptions' => ['data-method' => 'post'],
      ],
      

    提交回复
    热议问题