Browse Source

doc fix.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
89472955e5
  1. 17
      composer.json
  2. 17
      framework/composer.json
  3. 6
      framework/yii/data/SqlDataProvider.php

17
composer.json

@ -1,6 +1,6 @@
{ {
"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 @@
"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": {

17
framework/composer.json

@ -1,6 +1,6 @@
{ {
"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 @@
"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": {

6
framework/yii/data/SqlDataProvider.php

@ -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;
* '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();
* ~~~ * ~~~

Loading…
Cancel
Save