Yii2中,使用form提交数据,会提示:

[yii\web\HttpException:400] exception 'yii\web\BadRequestHttpException' with message '您提交的資料無法被驗證。'的错误信息。

我尝试在form中添加

<?= Html::csrfMetaTags() ?>

错误依旧。

尝试在控制器中添加

public $enableCsrfValidation = false;

就可以了。

参考连接:

  1. Why get Unable to verify your data submission error in Yii2?

  2. Bad Request (#400) - Unable to verify your data submission 

相关文章:

  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-15
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-08-10
  • 2022-01-29
相关资源
相似解决方案