srun / provider
The srun4-api's ActiveDataProvider is parsed to use the GridView
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/srun/provider
Requires
- yiisoft/yii2: ~2.0.45
This package is auto-updated.
Last update: 2025-12-20 05:47:24 UTC
README
##Srun-Provider The srun4-api's ActiveDataProvider is parsed to use the GridView
解析srun4k-api 的ActiveDataProvider 数据结构以使用 GirdView
因为接口返回 ActiveDataProvider 数据结构,而页面需要搭配 GridView 组件。
所以需要将数据源转换成DataProvider ,将 ArrayDataProvider 去掉分页逻辑。
Installation
Either run
composer require srun/provider
or add
"srun/provider":"*"
to the require section of your composer.json file.
Usage
return new \srun\provider\ApiDataProvider([ 'allModels' => $data, /*@var array 数据源*/ 'totalCount' => $totalCount, /*@var int 总数*/ 'pagination' => [ 'pageSize' => 10, /*@var int 分页大小*/ ], ]);