磊哥韩 2014-11-12 15:09:18 3251次浏览 0条回复 0 0 0

方法中写法: 复制代码

public function actionIndex(){
	$categoryModel = Category::model();
	$criteria = new CDbCriteria();
	$criteria->order = 'id ASC';
	$criteria->addCondition('status=1'); //根据条件查询
	$count = Category::model()->count($criteria);
	$pager = new CPagination($count);
	$pager->pageSize=2;
	$pager->applyLimit($criteria);
	$categoryInfo = Category::model()->findAll($criteria);
	 
	$this->render('index',array('pages'=>$pager,'categoryInfo'=>$categoryInfo));
}

view视图中的调用: 复制代码

<?php 
$this->widget('CLinkPager',array(
    'header'=>'',
    'firstPageLabel' => '首页',
    'lastPageLabel' => '最后一页',
    'prevPageLabel' => '上一页',
    'nextPageLabel' => '下一页',
    'pages' => $pages,
    'maxButtonCount'=>3,
));
?>

我yii 配置的smarty 模板,yii如何结合smarty分页呢

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册