Commit 95c6d7d6 by Qiang Xue

web WIP

parent 4fdaab35
<?php <?php
/** /**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/ * @link http://www.yiiframework.com/
* @copyright Copyright &copy; 2008-2011 Yii Software LLC * @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/ * @license http://www.yiiframework.com/license/
*/ */
namespace yii\web;
/** /**
* CPagination represents information relevant to pagination. * Pagination represents information relevant to pagination.
* *
* When data needs to be rendered in multiple pages, we can use CPagination to * When data needs to be rendered in multiple pages, we can use Pagination to
* represent information such as {@link getItemCount total item count}, * represent information such as {@link getItemCount total item count},
* {@link getPageSize page size}, {@link getCurrentPage current page}, etc. * {@link getPageSize page size}, {@link getCurrentPage current page}, etc.
* These information can be passed to {@link CBasePager pagers} to render * These information can be passed to {@link CBasePager pagers} to render
...@@ -18,11 +19,13 @@ ...@@ -18,11 +19,13 @@
* Example: * Example:
* *
* Controller action: * Controller action:
* <pre> *
* function actionIndex(){ * ~~~
* function actionIndex()
* {
* $criteria=new CDbCriteria(); * $criteria=new CDbCriteria();
* $count=Article::model()->count($criteria); * $count=Article::model()->count($criteria);
* $pages=new CPagination($count); * $pages=new Pagination($count);
* *
* // results per page * // results per page
* $pages->pageSize=10; * $pages->pageSize=10;
...@@ -34,7 +37,7 @@ ...@@ -34,7 +37,7 @@
* 'pages' => $pages * 'pages' => $pages
* )); * ));
* } * }
* </pre> * ~~~
* *
* View: * View:
* <pre> * <pre>
...@@ -59,11 +62,9 @@ ...@@ -59,11 +62,9 @@
* This returns the same value as {@link pageSize}. * This returns the same value as {@link pageSize}.
* *
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$ * @since 2.0
* @package system.web
* @since 1.0
*/ */
class CPagination extends CComponent class Pagination extends \yii\base\Object
{ {
/** /**
* The default page size. * The default page size.
......
<?php <?php
/** /**
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/ * @link http://www.yiiframework.com/
* @copyright Copyright &copy; 2008-2011 Yii Software LLC * @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/ * @license http://www.yiiframework.com/license/
*/ */
namespace yii\web;
/** /**
* CSort represents information relevant to sorting. * CSort represents information relevant to sorting.
* *
...@@ -41,10 +42,9 @@ ...@@ -41,10 +42,9 @@
* CSort::SORT_DESC for descending order. * CSort::SORT_DESC for descending order.
* *
* @author Qiang Xue <qiang.xue@gmail.com> * @author Qiang Xue <qiang.xue@gmail.com>
* @version $Id$ * @since 2.0
* @package system.web
*/ */
class CSort extends CComponent class Sort extends \yii\base\Object
{ {
/** /**
* Sort ascending * Sort ascending
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment