PHPackages                             2amigos/yii2-arrayquery-component - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. 2amigos/yii2-arrayquery-component

AbandonedArchivedYii2-extension[Search &amp; Filtering](/categories/search)

2amigos/yii2-arrayquery-component
=================================

Yii2 component that allows for searching/filtering the elements of an array.

1.0.3(8y ago)20405.3k↓37.7%87BSD-3-ClausePHP

Since Feb 24Pushed 8y ago9 watchersCompare

[ Source](https://github.com/2amigos/yii2-arrayquery-component)[ Packagist](https://packagist.org/packages/2amigos/yii2-arrayquery-component)[ Docs](http://yiiwheels.com/extension/arrayquery-component)[ RSS](/packages/2amigos-yii2-arrayquery-component/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (7)Used By (7)

ArrayQuery Component for Yii2
=============================

[](#arrayquery-component-for-yii2)

[![Latest Version](https://camo.githubusercontent.com/4c0e285af6cae2ec533565704465cd4454e314e21567d5a59a726ab75be01f4f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f32616d69676f732f796969322d617272617971756572792d636f6d706f6e656e742e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/2amigos/yii2-arrayquery-component/tags)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/28cd18d8d53bff9967b92b3460cee32f615152012d62df8c344b3bea2fa1a960/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f32616d69676f732f796969322d617272617971756572792d636f6d706f6e656e742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/2amigos/yii2-arrayquery-component)[![Coverage Status](https://camo.githubusercontent.com/ae1569709a1e890d25e51f71731819cb37fd2f4c086d5f63745c964c150ace5b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f32616d69676f732f796969322d617272617971756572792d636f6d706f6e656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/yii2-arrayquery-component/code-structure)[![Quality Score](https://camo.githubusercontent.com/7df38a775111212c612abb113bcc926e9ed65fb8b947d67cb36562fcabecae47/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f32616d69676f732f796969322d617272617971756572792d636f6d706f6e656e742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/2amigos/yii2-arrayquery-component)[![Total Downloads](https://camo.githubusercontent.com/07da46f75d436a1e0cd102b420e8d955836000c53108241cd5c990a0cb536693/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f32616d69676f732f796969322d617272617971756572792d636f6d706f6e656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/2amigos/yii2-arrayquery-component)

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

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

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
-----

[](#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
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Antonio Ramirez](https://github.com/tonydspaniard)
- [All Contributors](../../contributors)

License
-------

[](#license)

The BSD License (BSD). Please see [License File](LICENSE.md) for more information.

> [![2amigOS!](https://camo.githubusercontent.com/9fd8f1de41dc23003bb2a54034cb6658dde5be97092e195a62d629d0d7fa7f6c/687474703a2f2f7777772e67726176617461722e636f6d2f6176617461722f35353336333339346437323934356666376564333132353536656330343165302e706e67)](http://www.2amigos.us)

*Custom Software | Web &amp; Mobile Software Development*[www.2amigos.us](http://www.2amigos.us)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity67

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~245 days

Recently: every ~306 days

Total

6

Last Release

3261d ago

Major Versions

0.1.1 → 1.0.02015-03-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/566016?v=4)[Antonio Ramirez](/maintainers/tonydspaniard)[@tonydspaniard](https://github.com/tonydspaniard)

---

Tags

arrayquerycomponentyii2yii2extensionyiicomponentyii 22amigosarrayquery

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/2amigos-yii2-arrayquery-component/health.svg)

```
[![Health](https://phpackages.com/badges/2amigos-yii2-arrayquery-component/health.svg)](https://phpackages.com/packages/2amigos-yii2-arrayquery-component)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
