public function actionIndex() { if (isset($_POST['limit'])) { $limit = $_POST['limit']; } else { $limit = 20; } if (isset($_POST['start'])) { $start = $_POST['start']; } else { $start = 0; } //$model = new PeMember('search'); //$model->unsetAttributes(); $criteria = new CDbCriteria(); //$criteria->limit = $limit; //$criteria->offset = $start; $model = PeMember::model()->findAll($criteria); $total = PeMember::model()->count($criteria); if (isset($_GET['PeMember'])) { $model->attributes = $_GET['PeMember']; } if (isset($_GET['output']) && $_GET['output'] == 'json') { $this->renderJson($model, $total); } else { $model = new PeMember('search'); $model->unsetAttributes(); $this->render('admin', array('model' => $model)); } }