我使用分页在cakephp 2.x中显示监控列表。此外,我已经给出了编辑任何调查的详细信息的链接。现在,当我编辑任何调查并重定向到监视列表时,分页返回第一页,我希望分页返回到之前的同一页面.Plzzz帮助我.. ...
我的编辑调查代码是: -
1 abc test False
2 abc test True
3 abc test True
4 abc test False
5 abc test True
}
对于监控人员的操作是: -
public function editsurvey($id){
$dt=$this->Survey->find('first',array('conditions'=>array('id'=>$id)));
// pr($dt['Survey']['no_of_ques']);exit;
if($this->request->is(array('post','put'))){
$data = $this->request->data['Survey'];
// pr($data['no_of_ques']);exit;
if($data['no_of_ques'] < $dt['Survey']['no_of_ques'] ){
//pr("Which Questions you want to delete");
// $id=$dt['Survey']['id'];
return $this->redirect(array('action' => 'deleteques',$id));
}
$this->Survey->id=$id;
if($this->Survey->save($this->request->data)){
$this->Flash->success(__('You have successfully updated survey'));
$this->redirect(array('action'=>'surveylist'));
}
}else{
$data=$this->Survey->findById($id);
$this->request->data=$data;
}