Allows searching/filtering of an array. This component is very useful when displaying array data in GridViews with an ArrayDataProvider.
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.
\\ $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
Please see CONTRIBUTING for details.
The BSD License (BSD). Please see License File for more information.
Web development has never been so fun! www.2amigos.us