Пример #1
0
 public function actionIndex()
 {
     $criteria = new CDbCriteria();
     //$criteria->order = 'sorter';
     $criteria->order = 'date_created DESC';
     $criteria->condition = 'active=' . Vacancy::STATUS_ACTIVE;
     $pages = new CPagination(Vacancy::model()->count($criteria));
     $pages->pageSize = param('module_vacancy_itemsPerPage', 10);
     $pages->applyLimit($criteria);
     $vacancy = Vacancy::model()->cache(param('cachingTime', 1209600), Vacancy::getCacheDependency())->findAll($criteria);
     $this->render('index', array('vacancy' => $vacancy, 'pages' => $pages));
 }