2amigos/yii2-arrayquery-component Yii2 component that allows for searching/filtering the elements of an array.

extension2amigoscomponentarrayquery

ArrayQuery Component for Yii2

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

Allows searching/filtering of an array. This component is very useful when displaying array data in GridViews with an ArrayDataProvider.

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

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

to the require section of your application's composer.json file.

Usage

\\ $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
    ],
]);

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The BSD License (BSD). Please see License File for more information.

2amigOS!

Custom Software | Web & Mobile Software Development www.2amigos.us

Changelog

Changelog

1.0.1 - 2015-03-04

Changed

  • Added CONTRIBUTING.md file

1.0.0 - 2015-03-04

Changed

Fixed

  • Fixed bug when checking "or" conditions

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.3 is the latest of 6 releases



BSD-3-Clause license
Stats
21 github stars & 8 github forks
248 downloads in the last day
4667 downloads in the last 30 days
267740 total downloads