CakePHP / How to determine AJAX request

Depends on the version of cake.
1.3.x:
$this->ResquestHandler->isAjax();
2.x:
$this->request->is('ajax');
If you'll use $this->ResquestHandler->isAjax(); for 2.x, Cake will throw deprecation warning.

No comments:

Post a Comment