Ajax + Controller Action in Yii2

前端 未结 3 1337
终归单人心
终归单人心 2020-12-25 15:42

I\'m new to programming, and I\'m trying to call a function when the user inputs data and clicks submit button. I\'m using Yii2 and I\'m not familiar with Ajax. I tried deve

3条回答
  •  借酒劲吻你
    2020-12-25 16:04

    you have to pass _csrf tokin as a parameter

    _csrf: yii.getCsrfToken()
    

    or you can disable csrf valdation

提交回复
热议问题