* function actionIndex(){ * $criteria=new CDbCriteria(); * $count=Article::model()->count($criteria); * $pages=new CPagination($count); * * // results per page * $pages->pageSize=10; * $pages->applyLimit($criteria); * $models=Article::model()->findAll($criteria); * * $this->render('index', array( * 'models' => $models, * 'pages' => $pages * )); * } *
* * // display a model * * * // display pagination * widget('CLinkPager', array( * 'pages' => $pages, * )) ?> *