Example #1
0
 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $criteria = new CDbCriteria();
     $criteria->order = 'cTime DESC';
     //$criteria->select = 'id,title';
     $model = new Ads();
     $count = $model->count($criteria);
     $pager = new CPagination($count);
     $pager->pageSize = 100;
     $pager->applyLimit($criteria);
     $posts = $model->findAll($criteria);
     $this->render('index', array('pages' => $pager, 'posts' => $posts));
 }