I use a few different AJAX calls in one of my pages through a couple of different methods.
CHtml::link()
CHtml::ajax()
- Within
CGridview
Since enabling CSRF I'm having difficulty verifying the token. What is the correct way? I've read a few posts, but struggling to implement. For instance in CHtml::link()
I've tried:
'data' => "Yii::app()->request->csrfTokenName = Yii::app()->request->csrfToken",
and also within CGridview
:
data: {
Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken
},