Ejemplo n.º 1
0
 /**
  * 首页
  *
  */
 public function actionIndex()
 {
     parent::_acl('province_index');
     $model = new Province();
     $criteria = new CDbCriteria();
     $criteria->order = 'id ASC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('index', array('datalist' => $result, 'pagebar' => $pages));
 }