2amigos/yii2-arrayquery-component

此包已废弃且不再维护。未建议替代包。

允许搜索/过滤数组元素的Yii2组件。

安装量: 298,466

依赖者: 12

建议者: 0

安全: 0

星标: 21

关注者: 20

分支: 8

类型:yii2-extension

1.0.3 2017-07-05 10:05 UTC

This package is auto-updated.

Last update: 2023-08-16 02:59:54 UTC


README

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

允许搜索/过滤数组。此组件在用ArrayDataProvider在GridView中显示数组数据时非常有用。

安装

通过 composer 安装此扩展是首选方式。

运行以下命令

php composer.phar require "2amigos/yii2-arrayquery-component" "*"

或在您的应用程序的 composer.json 文件的 require 部分添加以下内容

"2amigos/yii2-arrayquery-component" : "*"

使用

\\ $models is the array elements to used with ArrayDataProvider

$query = new ArrayQuery($models);

$models = $query
    ->addCondition('name', '~2amigos')
    ->addCondition('name', 'cebe/yii2-gravatar', 'or')
    ->find();

$dataProvider = new ArrayDataProvider([
    'allModels' => $models,
    'pagination' => [
        'pageSize' => 50,
    ],
    'sort' => [
        'attributes' => [], // to be specified
    ],
]);

测试

$ phpunit

贡献

有关详细信息,请参阅 CONTRIBUTING

致谢

许可

BSD许可(BSD)。有关更多信息,请参阅 许可文件

2amigOS!

定制软件 | 网络与移动软件开发 www.2amigos.us