All Projects → leandrogehlen → yii2-querybuilder

leandrogehlen / yii2-querybuilder

Licence: other
Extension for Yii2 Framework to work with jQuery QueryBuilder

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-querybuilder

yii2-lock-form
disable the button when form submit
Stars: ✭ 37 (-9.76%)
Mutual labels:  yii2, yii2-widgets
yii2-sweet-submit
sweet sumit using sweetalert
Stars: ✭ 26 (-36.59%)
Mutual labels:  yii2, yii2-widgets
yii2-time-down-counter
Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library
Stars: ✭ 15 (-63.41%)
Mutual labels:  yii2, yii2-widgets
yii2-fileapi-widget
Yii2 FileAPI widget.
Stars: ✭ 51 (+24.39%)
Mutual labels:  yii2, yii2-widgets
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-73.17%)
Mutual labels:  yii2, yii2-widgets
yii2-render-many
Trait for Yii Framework 2
Stars: ✭ 14 (-65.85%)
Mutual labels:  yii2
yii2-widget-activeform
Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).
Stars: ✭ 61 (+48.78%)
Mutual labels:  yii2-widgets
yii2-notifications
This Yii2 extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack, Telegram etc.
Stars: ✭ 62 (+51.22%)
Mutual labels:  yii2
yii2-merchant
Payment merchants extension for Yii2
Stars: ✭ 17 (-58.54%)
Mutual labels:  yii2
yii2-jwt-tools
An easy way to configure JWT authentication and validation on Yii Framework 2 Projects
Stars: ✭ 22 (-46.34%)
Mutual labels:  yii2
yii2-realtime-chat-example
Yii2 simple realtime chat with websocket.io
Stars: ✭ 17 (-58.54%)
Mutual labels:  yii2
funboot
基于Yii2的Saas快速开发平台,内置多商户并内置商城、论坛、CMS等子系统。Yii2/Mysql/Mongodb/Redis/Elasticsearch/SnowFlake雪花算法ID生成 RBAC动态权限 数据权限 定时任务 日志/消息 代码生成Gii升级
Stars: ✭ 273 (+565.85%)
Mutual labels:  yii2
yii2-config-kit
Configuration kit for Yii applications
Stars: ✭ 24 (-41.46%)
Mutual labels:  yii2
yii2-pgsql
Improved PostgreSQL schemas for Yii2
Stars: ✭ 34 (-17.07%)
Mutual labels:  yii2
yii2-newsletter
Module for saving user contacts from newsletter form to database
Stars: ✭ 17 (-58.54%)
Mutual labels:  yii2
luya-module-cms
The LUYA CMS module provides a full functional CMS for adding contents based on blocks.
Stars: ✭ 28 (-31.71%)
Mutual labels:  yii2
yii2-inertia
The Yii 2 server-side adapter for Inertia.js.
Stars: ✭ 52 (+26.83%)
Mutual labels:  yii2
yii2-cashier
Yii2 Cashier provides an interface to Stripe's subscription billing services.
Stars: ✭ 43 (+4.88%)
Mutual labels:  yii2
yii2-modal-ajax
A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside.
Stars: ✭ 48 (+17.07%)
Mutual labels:  yii2-widgets
ar-search
Provides unified search model for Yii ActiveRecord
Stars: ✭ 31 (-24.39%)
Mutual labels:  yii2

jQuery QueryBuilder Extension for Yii 2

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

Yii2 Latest Stable Version Scrutinizer Code Quality Code Coverage Build Status Code Climate Total Downloads

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.

How to use

The extension depends the bootstrap css then is necessary adds it in AppAsset:

class AppAsset extends AssetBundle {

    ...

    public $depends = [
        ...
        'yii\bootstrap\BootstrapAsset', // or 'yii\bootstrap4\BootstrapAsset'
    ];

}

View:

use leandrogehlen\querybuilder\QueryBuilderForm;

<?php QueryBuilderForm::begin([
    'rules' => $rules,
    'builder' => [
        'id' => 'query-builder',
        'pluginOptions' => [
            'filters' => [
                ['id' => 'id', 'label' => 'Id', 'type' => 'integer'],
                ['id' => 'name', 'label' => 'Name', 'type' => 'string'],
                ['id' => 'lastName', 'label' => 'Last Name', 'type' => 'string']
            ]
        ]
    ]
 ])?>

    <?= Html::submitButton('Apply'); ?>
    <?= Html::resetButton('Reset'); ?>

<?php QueryBuilderForm::end() ?>

Controller:

use leandrogehlen\querybuilder\Translator;

public function actionIndex()
{
    $query = Customer::find();
    $rules = Json::decode(Yii::$app->request->get('rules'));
    if ($rules) {
        $translator = new Translator($rules);
        $query->andWhere($translator->where())
              ->addParams($translator->params());
    }

    $dataProvider = new ActiveDataProvider([
        'query' => $query,
    ]);

    return $this->render('index', [
        'dataProvider' => $dataProvider,
        'rules' => $rules
    ]);
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].