2017 © Pedro Peláez
 

yii2-extension yii2-querybuilder

Extension for Yii2 Framework to work with jQuery QueryBuilder

image

leandrogehlen/yii2-querybuilder

Extension for Yii2 Framework to work with jQuery QueryBuilder

  • Saturday, June 24, 2017
  • by leandrogehlen
  • Repository
  • 5 Watchers
  • 26 Stars
  • 3,218 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 15 Forks
  • 1 Open issues
  • 3 Versions
  • 3 % Grown

The README.md

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, (*1)

Yii2 Latest Stable Version Scrutinizer Code Quality Code Coverage Build Status Code Climate Total Downloads, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist leandrogehlen/yii2-querybuilder "*"

or add, (*5)

"leandrogehlen/yii2-querybuilder": "*"

to the require section of your composer.json file., (*6)

How to use

The extension depends the bootstrap css then is necessary adds it in AppAsset:, (*7)

class AppAsset extends AssetBundle {

    ...

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

}

View:, (*8)


use leandrogehlen\querybuilder\QueryBuilderForm; $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'); ?>

Controller:, (*9)


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 ]); }

The Versions

24/06 2017

dev-master

9999999-dev

Extension for Yii2 Framework to work with jQuery QueryBuilder

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 query interface dynamic querybuilder builder

15/06 2017

1.0.1

1.0.1.0

Extension for Yii2 Framework to work with jQuery QueryBuilder

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 query interface dynamic querybuilder builder

16/07 2015

1.0.0

1.0.0.0

Extension for Yii2 Framework to work with jQuery QueryBuilder

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

yii2 query interface dynamic querybuilder builder