Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.

Post Page Advertisement [Top]

 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');                       
            }
        }

No comments:

Post a Comment

Bottom Ad [Post Page]