yii 提交表单报400错误,提示 “您提交的数据无法验证”,问题处理。

正确做法:

 Add this in the head section of your layout:

  <?= Html::csrfMetaTags() ?>


不推荐的做法,以下做法是取消CSRF令牌验证

Add this in your controller:

public $enableCsrfValidation = false;


你可能感兴趣的:(yii 提交表单报400错误,提示 “您提交的数据无法验证”,问题处理。)