标签:style class color get os cti
$criteria = new CDbCriteria;
$criteria->order = ‘id asc‘; //这边还可以写其他的sql语句
$count = Bankinfo::model()->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 1;
$pages->applylimit($criteria);
$bankinfos = Bankinfo::model()->findAll($criteria);
$this->render(‘index‘, array(
‘bankinfos‘ => $bankinfos,
‘pages‘ => $pages,
));
<div class="green-black">
<?php
$this->widget(‘MyLinkPager‘,array(
‘pages‘=>$pages,
));
?>
</div>
<?php if($pages->pageCount > 1):?>
<div class="page_margin">
<ul class="pagination ">
<li class="<?php echo $pages->currentPage <= 0?‘disabled‘:‘‘; ?>"><a href="<?php echo $pages->currentPage <= 0?‘‘:$this->createUrl(‘bank/index‘,array(‘page‘=>$pages->currentPage));?>">«</a></li>
<?php for($i = 1;$i <= $pages->pageCount;$i++):?>
<li class="<?php echo $pages->currentPage +1 == $i?‘active‘:‘‘; ?>"><a href="<?php echo $this->createUrl(‘bank/index‘,array(‘page‘=>$i));?>"><?php echo $i; ?></a></li>
<?php endfor; ?>
<li class="<?php echo $pages->currentPage+1 >= $pages->pageCount?‘disabled‘:‘‘; ?>"><a href="<?php echo $pages->currentPage+1 >= $pages->pageCount?‘‘:$this->createUrl(‘bank/index‘,array(‘page‘=>$pages->currentPage+2));?>">»</a></li>
</ul>
</div>
<?php endif;?>
Yii 之分页 + bootstrap,布布扣,bubuko.com
标签:style class color get os cti
原文地址:http://www.cnblogs.com/zhongyuan/p/3806239.html