Revision #2 was created by robregonm on Jan 20, 2014, 2:46:56 PM.
Small syntax updates and style fixes.
Content
Hello Yii friends
I am going to write an article. ThatMany times we write asame code on every ajax call, but writing a single code in one controller is sufficient in ajax post with csrf security which is very easy.
At first go to components and open the controller.php
Simply add the following code:-
```php
// this function will be initialize in every controller call which will call initAjaxCsrfToken function
public function init() {
parent::init();
$this->initAjaxCsrfToken();
}
// this function will work to post csrf token.