Class MobilePagination
CPagination represents information relevant to pagination.
When data needs to be rendered in multiple pages, we can use CPagination to represent information such as getItemCount total item count, getPageSize page size, getCurrentPage current page, etc. These information can be passed to CBasePager pagers to render pagination buttons or links.
Example:
Controller action:
function actionIndex(){ $criteria=new CDbCriteria(); $count=Article::model()->count($criteria); $pages=new CPagination($count); // results per page $pages->pageSize=10; $pages->applyLimit($criteria); $models=Article::model()->findAll($criteria); $this->render('index', array( 'models' => $models, 'pages' => $pages )); }
View:
<?php foreach($models as $model): ?> // display a model <?php endforeach; ?> // display pagination <?php $this->widget('CLinkPager', array( 'pages' => $pages, )) ?>
- CComponent
- CPagination
- MobilePagination
Package: system\web
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/modules/mobile/components/MobilePagination.php
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/protected/modules/mobile/components/MobilePagination.php
public
string
|
#
createPageUrl( CController $controller, integer $page )
Creates the URL suitable for pagination. This method is mainly called by pagers when creating URLs used to perform pagination. The default implementation is to call the controller's createUrl method with the page information. You may override this method if your URL scheme is not the same as the one supported by the controller's createUrl method. |
__construct(),
applyLimit(),
getCurrentPage(),
getItemCount(),
getLimit(),
getOffset(),
getPageCount(),
getPageSize(),
setCurrentPage(),
setItemCount(),
setPageSize()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
DEFAULT_PAGE_SIZE
|
$pageVar,
$params,
$route,
$validateCurrentPage
|
$currentPage,
$itemCount,
$limit,
$offset,
$pageCount,
$pageSize
|