Yii implementation of simple paging method, YII implementation of paging
This paper describes the method of implementing simple paging in Yii. Share to everyone for your reference, as follows:
Yii Paging method
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 View Methods
<?php foreach ($models as $model):?>
- <?php echo $model->title;? >
<?php Endforeach;?>
<?php $this->widget (' Clinkpager ', Array ( ' pages ' = $pages, ' header ' = ' = ', ' prevpagelabel ' = ' prev ', ' nextpagelabel ' ' = ' next ', ' cssfile ' and ' CSS ' /cc/css.css ',))?>
For more information on YII related content readers can view this site topic: "YII framework Introduction and common skills Summary", "PHP Excellent Development Framework Summary", "Smarty Template Primer Basic Tutorial", "PHP date and Time usage summary", "PHP object-oriented Programming introduction Tutorial", " PHP String Usage Summary, "Getting Started with Php+mysql database operations" and "PHP Common Database Operations Skills Summary"
It is hoped that this article is helpful to the PHP program design based on YII framework.
http://www.bkjia.com/PHPjc/1125260.html www.bkjia.com true http://www.bkjia.com/PHPjc/1125260.html techarticle Yii realizes the simple paging method, the Yii realizes the pagination this article narrates the method which the Yii realizes the simple paging. Share to everyone for reference, as follows: Yii paging method Function Act ...