2amigos/yii2-arrayquery-component
Yii2 component that allows for searching/filtering the elements of an array.
Maintainers
Package info
github.com/2amigos/yii2-arrayquery-component
Type:yii2-extension
pkg:composer/2amigos/yii2-arrayquery-component
Requires
- yiisoft/yii2: ~2.0.11
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ~5.6
- scrutinizer/ocular: ~1.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
BSD-3-Clause 7f621370e1e954237741aa6d23eb5a5f21c985f3
- 2amigOS! Consulting Group <hola.woop@2amigos.us>
README
👁 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.
Custom Software | Web & Mobile Software Development www.2amigos.us
