This is the jQuery QueryBuilder extension for Yii 2. It encapsulates QueryBuilder component in terms of Yii widgets, and thus makes using QueryBuilder component in Yii applications extremely easy
Installation ¶
The preferred way to install this extension is through composer.
Either run ~~~ php composer.phar require --prefer-dist leandrogehlen/yii2-querybuilder "*" ~~~
or add
"leandrogehlen/yii2-querybuilder": "*"
to the require section of your composer.json file.
Usage ¶
<?php use leandrogehlen\querybuilder\QueryBuilder; ?>
<?= QueryBuilder::widget([
'filters' => [
[
'id' => 'name',
'label' => 'Name',
'type' => 'string',
], [
'id' => 'category',
'label' => 'Category',
'type' => 'integer',
'input' => 'select',
'values' => [
1 => 'Books',
2 => 'Movies',
]
]
]
]) ?>
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.