Ajax + Controller Action in Yii2

前端 未结 3 1311
终归单人心
终归单人心 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:00

    The correct way to get the CSRF param is this:

    data[yii.getCsrfParam()] = yii.getCsrfToken()
    

提交回复
热议问题