Yii 2.0 针对特定 action关闭CSRF验证
/**
* @inheritdoc
*/
public function beforeAction($action)
{
if ($action->id == 'yiilib-method') {
$this->enableCsrfValidation = false;
}
return parent::beforeAction($action);
}
留言