Yii2使用a链接发送post请求
<?=Html::a(' <img class="list-group-item-icon" src="/frontend/web/images/kplus/list_tuichu@2x.png">退出 <img class="list-group-item-icon icon-right" src="/frontend/web/images/kplus/list_right@2x.png"> ', Url::to(['/site/logout']), [ 'class' => 'list-group-item', 'data' => [ 'method' => 'post', 'params' => [ '_csrf-frontend' => Yii::$app->request->csrfToken ] ] ] ) ?>