gvasilopulos / yii2-enhanced-gii
Generate Relational (hasMany, hasOne, belongsTo, & nested) Models & CRUD.
Installs: 170
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 97
Type:yii2-extension
This package is not auto-updated.
Last update: 2025-02-24 16:31:04 UTC
README
Yii2 Gii (generator) with Relation forked from https://github.com/mootensai/yii2-enhanced-gii
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
You have to add this to your configuration db connection setting so it detects uuid column properly
'schemaMap' => [
'pgsql'=> [
'class'=>'gvasilopulos\enhancedgii\db\pgsql\Schema',
'defaultSchema' => 'public' //specify your schema here
],
],
You can change the Schema name to whatever you use
Installation
The preferred way to install this extension is through composer.
Either run
$ 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
"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
add
"kartik-v/yii2-tree-manager": "dev-master",
if you want to use tree/nested relation table
to the require
section of your composer.json
file.
I separate the mpdf & tree-manager because the package is big & not everyone will use it.
Then you must add this code at your config\main.php.
'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
See datecontrol settings on http://demos.krajee.com/datecontrol#module
See treemanager settings on http://demos.krajee.com/tree-manager#module (If you use tree/nested relation table)
See dynagrid settings on http://demos.krajee.com/dynagrid if you use mediman crud template!
Usage :
Go to your gii tools, and notice the new IO Generator for models & CRUD
#Features
Model :
- Generate optimistic lock
- Generate Timestamp Behaviors
- Generate Blameable Behavior
- Generate UUID Behavior and uuid's through php (default behavior)
CRUD :
- Generate all CRUD with wildcard (*) of table
- Generate related input output
- Specify your name/label attribute for foreign keys
- Set your column to hidden
- Specify your skipped columns
- Specify your skipped relations
- Set pluralize or not
- PDF Printable view
- Expandable / collapsible row at index grid view for related data
- 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 :
- Generate migration from your database structure (based on : https://github.com/deesoft/yii2-gii)
To Do
- One-page-CRUD template
- Implement generator for Soft Delete Behavior (https://github.com/yii2tech/ar-softdelete)
I'm open for any improvement
Screenshot
Model Generator
CRUD Generator
Index
Grid View
List View
View
Form
Nested / Tree
Migration Generator
Thanks To
- Jiwanndaru (jiwanndaru@gmail.com) for creating the tradition
- kartik-v (https://github.com/kartik-v) for most of widgets
- schmunk42 (https://github.com/schmunk42) for bootstrap & model base & extension
- mdmunir (https://github.com/mdmunir) for JsBlock & Migration Generator (from https://github.com/deesoft/yii2-gii)
- thamtech (https://github.com/thamtech/yii2-uuid) for uuid helpers/validators
- wartron (https://github.com/wartron/yii2-uuid) UUID behavior
- fgh151 (https://github.com/fgh151/yii2-postgresql-array-field) for guidance through schema customization