2017 © Pedro Peláez
 

yii2-extension yii2-enhanced-gii

Generate Relational (hasMany, hasOne, belongsTo, & nested) Models & CRUD.

image

gvasilopulos/yii2-enhanced-gii

Generate Relational (hasMany, hasOne, belongsTo, & nested) Models & CRUD.

  • Monday, December 26, 2016
  • by gvasilopulos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 67 Forks
  • 1 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

yii2-enhanced-gii

Yii2 Gii (generator) with Relation forked from https://github.com/mootensai/yii2-enhanced-gii, (*1)

Specific for postgres with uuid id's generated from php through ramsey/uuid Beware! This extension does not use uuid-oosp functions it generates v4 uuid with UUID behaviour, (*2)

You have to add this to your configuration db connection setting so it detects uuid column properly, (*3)

       'schemaMap' => [
        'pgsql'=> [
        'class'=>'gvasilopulos\enhancedgii\db\pgsql\Schema',
        'defaultSchema' => 'public' //specify your schema here
         ],
        ],

You can change the Schema name to whatever you use, (*4)

Yii2, (*5)

Installation

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

Either run, (*7)

$ composer require gvasilopulos/yii2-enhanced-gii:dev-master
$ composer require kartik-v/yii2-mpdf:dev-master # if you want to use pdf exporter 
$ composer require kartik-v/yii2-tree-manager:dev-master # if you want to use tree/nested relation table

or add, (*8)

"gvasilopulos/yii2-enhanced-gii": "dev-master",
"kartik-v/yii2-mpdf": "dev-master",
"kartik-v/yii2-tree-manager": "dev-master"

add "kartik-v/yii2-mpdf": "dev-master", if you want to use pdf exporter, (*9)

add "kartik-v/yii2-tree-manager": "dev-master", if you want to use tree/nested relation table, (*10)

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

I separate the mpdf & tree-manager because the package is big & not everyone will use it., (*12)

Then you must add this code at your config\main.php., (*13)

'modules' => [
... //your another module
      'gridview' => [
          'class' => '\kartik\grid\Module',
          // see settings on http://demos.krajee.com/grid#module
      ],
      'datecontrol' => [
          'class' => '\kartik\datecontrol\Module',
          // see settings on http://demos.krajee.com/datecontrol#module
      ],
      // If you use tree table
      'treemanager' =>  [
          'class' => '\kartik\tree\Module',
          // see settings on http://demos.krajee.com/tree-manager#module
      ]
... // your another module
      'dynagrid'=> [
        'class'=>'\kartik\dynagrid\Module',
        // other module settings
      ],
    ],

See gridview settings on http://demos.krajee.com/grid#module, (*14)

See datecontrol settings on http://demos.krajee.com/datecontrol#module, (*15)

See treemanager settings on http://demos.krajee.com/tree-manager#module (If you use tree/nested relation table), (*16)

See dynagrid settings on http://demos.krajee.com/dynagrid if you use mediman crud template!, (*17)

Usage :

Go to your gii tools, and notice the new IO Generator for models & CRUD, (*18)

Features

Model :

  1. Generate optimistic lock
  2. Generate Timestamp Behaviors
  3. Generate Blameable Behavior
  4. Generate UUID Behavior and uuid's through php (default behavior)

CRUD :

  1. Generate all CRUD with wildcard (*) of table
  2. Generate related input output
  3. Specify your name/label attribute for foreign keys
  4. Set your column to hidden
  5. Specify your skipped columns
  6. Specify your skipped relations
  7. Set pluralize or not
  8. PDF Printable view
  9. Expandable / collapsible row at index grid view for related data
  10. generate dynagrid grid view for index.php if you choose mediman template on crud (you need to add tbl_dynagrid and tbl_dynagrid_dtl tables on your database or set the appropriate tables on module settings as described in http://demos.krajee.com/dynagrid#module

Migration Generator :

  1. Generate migration from your database structure (based on : https://github.com/deesoft/yii2-gii)

To Do

  1. One-page-CRUD template
  2. Implement generator for Soft Delete Behavior (https://github.com/yii2tech/ar-softdelete)

I'm open for any improvement, (*19)

Screenshot

Model Generator

enhanced gii - model, (*20)

CRUD Generator

enhanced gii - crud, (*21)

Index

Grid View

enhanced gii - index grid, (*22)

List View

enhanced gii - index list, (*23)

View

enhanced gii - view, (*24)

Form

enhanced gii - create, (*25)

enhanced gii - update, (*26)

Nested / Tree

enhanced gii - nested, (*27)

Migration Generator

migration form, (*28)

Thanks To

  1. Jiwanndaru (jiwanndaru@gmail.com) for creating the tradition
  2. kartik-v (https://github.com/kartik-v) for most of widgets
  3. schmunk42 (https://github.com/schmunk42) for bootstrap & model base & extension
  4. mdmunir (https://github.com/mdmunir) for JsBlock & Migration Generator (from https://github.com/deesoft/yii2-gii)
  5. thamtech (https://github.com/thamtech/yii2-uuid) for uuid helpers/validators
  6. wartron (https://github.com/wartron/yii2-uuid) UUID behavior
  7. fgh151 (https://github.com/fgh151/yii2-postgresql-array-field) for guidance through schema customization

The Versions

08/12 2016

dev-gvasilopulos-patch-93

dev-gvasilopulos-patch-93

Generate Relational (hasMany, hasOne, belongsTo, & nested) Models & CRUD.

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced

06/12 2016

dev-patch-1

dev-patch-1

Generate Relational (hasMany, hasOne, belongsTo, & nested) Models & CRUD.

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced

20/08 2016
05/03 2016

0.0.9

0.0.9.0

Generate Relational (has many) Models & CRUD. For nested : mootensai/yii2-enhanced-gii-nested

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced

22/02 2016

0.0.8

0.0.8.0

Generate Relational (has many) Models & CRUD. For nested : mootensai/yii2-enhanced-gii-nested

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced

17/02 2016

0.0.7

0.0.7.0

Generate Relational (has many) Models & CRUD. For nested : mootensai/yii2-enhanced-gii-nested

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced

22/08 2015

0.0.6

0.0.6.0

Generate Relational (has many) Models & CRUD. For nested : mootensai/yii2-enhanced-gii-nested

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced

28/07 2015

0.0.5

0.0.5.0

Generate Relational (has many) Models & CRUD. For nested : mootensai/yii2-enhanced-gii-nested

  Sources   Download

BSD-3-Clause

The Requires

 

by Yohanes Candrajaya
by Jiwantoro Ndaru

yii2 gii yii relation enhanced