PHP7中文手册2018 带注释 最新chm版
yii分页方法
function actionPage(){
$criteria=new CDbCriteria();
$count=Archives::model()->count($criteria);
$pages=new CPagination($count);
// results per page
$pages->pageSize=10;
$pages->applyLimit($criteria);
$models=Archives::model()->findAll($criteria);
$this->render('Archives', array(
'models' => $models,
'pages' => $pages
));
}
view视图的方法
<ul>
<?php foreach($models as $model): ?>
<li><?php echo $model->title;?></li>
<?php endforeach; ?>
</ul>
<?php $this->widget('CLinkPager', array(
'pages' => $pages,
'header'=>'',
'prevPageLabel'=>'上一页',
'nextPageLabel'=>'下一页',
'cssFile'=>'css/cc/css.css',
)) ?>