Commit 89472955 by Qiang Xue

doc fix.

parent 98b4540e
{ {
"name": "yiisoft/yii2-dev", "name": "yiisoft/yii2-dev",
"description": "Yii2 Web Programming Framework - Development Package", "description": "Yii PHP Framework Version 2 - Development Package",
"keywords": ["yii", "framework"], "keywords": ["yii", "framework"],
"homepage": "http://www.yiiframework.com/", "homepage": "http://www.yiiframework.com/",
"type": "yii2-extension", "type": "yii2-extension",
...@@ -39,21 +39,6 @@ ...@@ -39,21 +39,6 @@
"name": "Paul Klimov", "name": "Paul Klimov",
"email": "klimov.paul@gmail.com", "email": "klimov.paul@gmail.com",
"role": "Core framework development" "role": "Core framework development"
},
{
"name": "Wei Zhuo",
"email": "weizhuo@gmail.com",
"role": "Project site maintenance and development"
},
{
"name": "Sebastián Thierer",
"email": "sebas@artfos.com",
"role": "Component development"
},
{
"name": "Jeffrey Winesett",
"email": "jefftulsa@gmail.com",
"role": "Documentation and marketing"
} }
], ],
"support": { "support": {
......
{ {
"name": "yiisoft/yii2", "name": "yiisoft/yii2",
"description": "Yii2 Web Programming Framework", "description": "Yii PHP Framework Version 2",
"keywords": ["yii", "framework"], "keywords": ["yii", "framework"],
"homepage": "http://www.yiiframework.com/", "homepage": "http://www.yiiframework.com/",
"type": "library", "type": "library",
...@@ -39,21 +39,6 @@ ...@@ -39,21 +39,6 @@
"name": "Paul Klimov", "name": "Paul Klimov",
"email": "klimov.paul@gmail.com", "email": "klimov.paul@gmail.com",
"role": "Core framework development" "role": "Core framework development"
},
{
"name": "Wei Zhuo",
"email": "weizhuo@gmail.com",
"role": "Project site maintenance and development"
},
{
"name": "Sebastián Thierer",
"email": "sebas@artfos.com",
"role": "Component development"
},
{
"name": "Jeffrey Winesett",
"email": "jefftulsa@gmail.com",
"role": "Documentation and marketing"
} }
], ],
"support": { "support": {
......
...@@ -25,7 +25,10 @@ use yii\db\Connection; ...@@ -25,7 +25,10 @@ use yii\db\Connection;
* SqlDataProvider may be used in the following way: * SqlDataProvider may be used in the following way:
* *
* ~~~ * ~~~
* $count = Yii::$app->db->createCommand('SELECT COUNT(*) FROM tbl_user')->queryScalar(); * $count = Yii::$app->db->createCommand('
* SELECT COUNT(*) FROM tbl_user WHERE status=:status
* ', [':status' => 1])->queryScalar();
*
* $dataProvider = new SqlDataProvider([ * $dataProvider = new SqlDataProvider([
* 'sql' => 'SELECT * FROM tbl_user WHERE status=:status', * 'sql' => 'SELECT * FROM tbl_user WHERE status=:status',
* 'params' => [':status' => 1], * 'params' => [':status' => 1],
...@@ -45,6 +48,7 @@ use yii\db\Connection; ...@@ -45,6 +48,7 @@ use yii\db\Connection;
* 'pageSize' => 20, * 'pageSize' => 20,
* ], * ],
* ]); * ]);
*
* // get the user records in the current page * // get the user records in the current page
* $models = $dataProvider->getModels(); * $models = $dataProvider->getModels();
* ~~~ * ~~~
......
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