/** * 首页 * */ public function actionIndex() { parent::_acl('banner_index'); $model = new Banner(); $criteria = new CDbCriteria(); $criteria->order = 'id DESC'; $count = $model->count($criteria); $pages = new CPagination($count); $pages->pageSize = 5; $criteria->limit = $pages->pageSize; $criteria->offset = $pages->currentPage * $pages->pageSize; $result = $model->findAll($criteria); $this->render('index', array('datalist' => $result, 'pagebar' => $pages)); }
/** * Display the banner list page */ public function banner_list() { $this->display('banner/views/index', array( 'banners' => Banner::findAll() )); }//*/