$model=Article::model(); $a = new CDbCriteria(); $a->order = ‘head DESC,time DESC‘; //从左到右按规则排序 $total = $model->count($a); $pager = new CPagination($total); $pager->pageSize = 15; $pager->applyLimit($a); $model = $model->findAll($a); $this->widget(‘CLinkPager‘,array( ‘header‘=>‘‘, ‘firstPageLabel‘ => ‘首页‘, ‘lastPageLabel‘ => ‘末页‘, ‘prevPageLabel‘ => ‘上一页‘, ‘nextPageLabel‘ => ‘下一页‘, ‘pages‘ => $pages, ‘maxButtonCount‘=>8, //加载第三方page css ‘cssFile‘=>false, ‘htmlOptions‘ =>array("class"=>"pagination"), ‘selectedPageCssClass‘=>"active" ) );
时间: 2024-11-05 14:57:42