How to check an Ajax request in cakephp?
+4
A:
- You need to enable the RequestHandler component
var $components = array('RequestHandler');
- Then you check if its an ajax request in your controllers with:
$this->ResquestHandler->isAjax()
You can find more information about the RequestHandler component here
pcp
2010-01-22 08:42:25
A:
Without the use of components you can use something like this:
$this->params['isAjax'];
This will return a bool.
gomflo
2010-01-22 23:59:56
A:
If you simply want to check the function of the php side, try:
$this->log('some debug',LOG_DEBUG);
then check app/tmp/logs/debug.log.
Leo
2010-01-25 15:24:39