Skip to content

Helper for grid filters, DB syncronization by model attributes

License

Notifications You must be signed in to change notification settings

goodizer/yii2-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-helpers

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

Installation

The preferred way to install this extension is through composer.

Note: Check the composer.json for this extension's requirements and dependencies.

Either run

$ php composer.phar require goodizer/yii2-helpers

or add

"goodizer/yii2-helpers": "*"

to the require section of your composer.json file.

Usage

GridSearchHelper

Create ActiveDataProvider object and build query by GET|POST data validated in model, which will be in filterModel property for GridView, ListView, etc.

use goodizer\helpers\GridSearchHelper;
use yii\grid\GridView;

$searchData = GridSearchHelper::search(new Note());
echo GridView::widget([
	'columns' => [
		'id',
		'name',
		'etc',
	],
    'filterModel' => $searchData->filterModel,
    'dataProvider' => $searchData->dataProvider,
]);

DbSyncHelper

Create or modify tables by model attribute types. Also can add CONSTRAINT REFERENCES.

use goodizer\helpers\DbSyncHelper;

$sync = new DbSyncHelper([
  'common\models',
  'modules\admin\models',
  'some\another\namespace',
]);
$sync->run();

About

Helper for grid filters, DB syncronization by model attributes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages