{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/10476","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/10476/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/10476/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/10476/events","html_url":"https://github.com/yiisoft/yii2/pull/10476","id":123836057,"number":10476,"title":"ArrayDataProvider add options `sliceModels`","user":{"login":"LAV45","id":675367,"avatar_url":"https://avatars.githubusercontent.com/u/675367?v=3","gravatar_id":"","url":"https://api.github.com/users/LAV45","html_url":"https://github.com/LAV45","followers_url":"https://api.github.com/users/LAV45/followers","following_url":"https://api.github.com/users/LAV45/following{/other_user}","gists_url":"https://api.github.com/users/LAV45/gists{/gist_id}","starred_url":"https://api.github.com/users/LAV45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LAV45/subscriptions","organizations_url":"https://api.github.com/users/LAV45/orgs","repos_url":"https://api.github.com/users/LAV45/repos","events_url":"https://api.github.com/users/LAV45/events{/privacy}","received_events_url":"https://api.github.com/users/LAV45/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-24T21:55:41Z","updated_at":"2015-12-25T08:44:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/10476","html_url":"https://github.com/yiisoft/yii2/pull/10476","diff_url":"https://github.com/yiisoft/yii2/pull/10476.diff","patch_url":"https://github.com/yiisoft/yii2/pull/10476.patch"},"body":"This option allows you to build proper paging when getting data from API\r\n\r\nMy example used\r\n```php\r\n$pageSize = 20;\r\n$page = Yii::$app->request->get('page', 1);\r\n\r\n// request to the Yii2 rest api server\r\n$response = Yii::$app->curl->get($this->api_url, [\r\n    'per-page' => $pageSize,\r\n    'page' => $page,\r\n]);\r\n\r\n$dataProvider = new ArrayDataProvider([\r\n    'sliceModels' => false,\r\n    'allModels' => Json::decode($response->body),\r\n    'totalCount' => $response->headers['X-Pagination-Total-Count'],\r\n    'pagination' => [\r\n        'pageSize' => $pageSize,\r\n    ],\r\n]);\r\n\r\nreturn $this->render('index', [\r\n    'dataProvider' => $dataProvider\r\n]);\r\n```"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/167210792","html_url":"https://github.com/yiisoft/yii2/pull/10476#issuecomment-167210792","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/10476","id":167210792,"user":{"login":"SilverFire","id":4499203,"avatar_url":"https://avatars.githubusercontent.com/u/4499203?v=3","gravatar_id":"","url":"https://api.github.com/users/SilverFire","html_url":"https://github.com/SilverFire","followers_url":"https://api.github.com/users/SilverFire/followers","following_url":"https://api.github.com/users/SilverFire/following{/other_user}","gists_url":"https://api.github.com/users/SilverFire/gists{/gist_id}","starred_url":"https://api.github.com/users/SilverFire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilverFire/subscriptions","organizations_url":"https://api.github.com/users/SilverFire/orgs","repos_url":"https://api.github.com/users/SilverFire/repos","events_url":"https://api.github.com/users/SilverFire/events{/privacy}","received_events_url":"https://api.github.com/users/SilverFire/received_events","type":"User","site_admin":false},"created_at":"2015-12-25T08:44:50Z","updated_at":"2015-12-25T08:44:50Z","body":"The use case is ok. We need unit-tests for the feature"}}