Yii2 Gii (generator) with Relation
The preferred way to install this extension is through composer.
Either run
$ composer require mootensai/yii2-enhanced-gii:@dev
or add
"mootensai/yii2-enhanced-gii": "@dev"
to the require
section of your composer.json
file.
Then you must add this code at your config\main.php.
'modules' => [
... //your another module
'gridview' => [
'class' => '\kartik\grid\Module',
],
... // your another module
],
Go to your gii tools, and notice the new IO Generator for models & CRUD
#Features
- Generate optimistic lock
- Generate Timestamp Behaviors
- Generate Blameable Behavior
- Generate UUID Behavior
- 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
Add this code to your css file to enhance you gridview header style:
.kartik-sheet-style {
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 0%, #f5f5f5 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f5f5f5));
background: -webkit-linear-gradient(top, #ffffff 0%,#f5f5f5 100%);
background: -o-linear-gradient(top, #ffffff 0%,#f5f5f5 100%);
background: -ms-linear-gradient(top, #ffffff 0%,#f5f5f5 100%);
background: linear-gradient(to bottom, #ffffff 0%,#f5f5f5 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f5f5f5',GradientType=0 );
}
And this code to fix the grid overflow issue:
div.rc-handle-container {
overflow: hidden;
}
- Nested set detector & generator -> cancelled, move to -> https://github.com/mootensai/yii2-enhanced-gii-nested (unfinished)
- One-page-CRUD template
- Generate migrations for tables (like https://github.com/mdmsoft/yii2-gii)
- RESTful template
I'm open for any improvement
- Jiwanndaru ([email protected]) 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
- iurijacob (https://github.com/iurijacob/yii2-enhanced-gii) for the first changes and inspiration