Controller Code
if(!empty($conditions)){
$this->paginate = array('limit'=>10,'order'=>'Admin.id desc');
$adminDetail = $this->paginate('Admin',$conditions);
$this->set('adminDetail',$adminDetail);
if($this->RequestHandler->isAjax()){
$this->layout = '';
$this->autoRender = false;
$this->render('admin_index');
}
}
else
{
$this->paginate = array('limit'=>'10','order'=>'Admin.id desc');
$adminDetail = $this->paginate('Admin');
$this->set('adminDetail',$adminDetail);
/***for pagination ajax response***/
if($this->RequestHandler->isAjax()) {
$this->layout = '';
$this->autoRender = false;
$this->render('admin_index');
}
}
if(!empty($conditions)){
$this->paginate = array('limit'=>10,'order'=>'Admin.id desc');
$adminDetail = $this->paginate('Admin',$conditions);
$this->set('adminDetail',$adminDetail);
if($this->RequestHandler->isAjax()){
$this->layout = '';
$this->autoRender = false;
$this->render('admin_index');
}
}
else
{
$this->paginate = array('limit'=>'10','order'=>'Admin.id desc');
$adminDetail = $this->paginate('Admin');
$this->set('adminDetail',$adminDetail);
/***for pagination ajax response***/
if($this->RequestHandler->isAjax()) {
$this->layout = '';
$this->autoRender = false;
$this->render('admin_index');
}
}
Comments
Post a Comment