В нем говорится, что CakeRequest теперь отвечает за это.Вы можете найти соответствующий параграф здесь: http://book.cakephp.org/2.0/en/controllers/request-response.html#inspecting-the-request
function add() {
if(!empty($this->request->data)) {
if($this->Post->save($this->request->data)) {
if($this->request->is('ajax')){
//Handle Ajax
$this->render('notif','ajax');
} else {
$this->Session->setFlash('Add successfully');
$this->redirect(array('action'=>'index'));
}
}
else {
$this->Session->setFlash('Add failded please try again');
}
}
}