ajaxFunction(){
$this->layout = 'ajax';
Configure::write('debug', 0);
if (!$this->RequestHandler->isAjax()) {
$this->cakeError('error', array(
array(
'code' => '404',
'name' => __('Page Not Found', true),
'message' => 'The Request URL does not exist on this server',
'title' => __('404', true),
'base' => $this->base,
'url' => $this->here
)
));
exit();
}
$response=array();
// получить данные в этом массиве
$response['result'] = Configure::read('Ajax.success');
$this->set('response',$response);
$this->renderXhrView();
}