/** * 首页 * */ public function actionIndex() { parent::_acl(); $model = new Lesson(); $criteria = new CDbCriteria(); $criteria->condition = $condition; $criteria->order = 't.id ASC'; //$criteria->with = array ( 'catalog' ); $count = $model->count($criteria); $pages = new CPagination($count); $pages->pageSize = 13; //$pageParams = XUtils::buildCondition( $_GET, array ( 'title' , 'catalogId','titleAlias' ) ); //$pages->params = is_array( $pageParams ) ? $pageParams : array (); $criteria->limit = $pages->pageSize; $criteria->offset = $pages->currentPage * $pages->pageSize; $result = $model->findAll($criteria); $this->render('lesson_index', array('datalist' => $result, 'pagebar' => $pages)); }
/** * Lists all models. */ public function actionIndex() { $model = new Lesson('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Lesson'])) { $model->attributes = $_GET['Lesson']; } $this->render('index', array('model' => $model, 'count' => $model->count())); }