petersonsilva / easyiigii
生成关系型模型(hasMany, hasOne, belongsTo, & 嵌套)和 CRUD。
1.0.3
2018-08-09 15:06 UTC
This package is auto-updated.
Last update: 2024-09-19 02:36:30 UTC
README
EasyYii Gii (生成器代码 Yii2) 与 PostgreSQL 的人关系
安装
通过 composer 安装此扩展是首选方式。
运行
composer require petersonsilva/easyiigii
或在您的 composer.json 文件的 require 部分添加以下内容:
"petersonsilva/easyiigii": "^1"
配置
- 然后您必须在您的
config/web.php中添加此代码。
'components'=>[ 'user' => [ 'class' => 'webvimark\modules\UserManagement\components\UserConfig', // Comment this if you don't want to record user logins 'on afterLogin' => function($event) { \webvimark\modules\UserManagement\models\UserVisitLog::newVisitor($event->identity->id); } ], ], 'modules' => [ 'user-management' => [ 'class' => 'webvimark\modules\UserManagement\UserManagementModule', 'on beforeAction'=>function(yii\base\ActionEvent $event) { if ( $event->action->uniqueId == 'user-management/auth/login' ){ $event->action->controller->layout = 'loginLayout.php'; }; }, ], 'gridview' => [ 'class' => '\kartik\grid\Module', ], 'datecontrol' => [ 'class' => '\kartik\datecontrol\Module', ], ],
有关 gridview 设置,请参阅 http://demos.krajee.com/grid#module
有关 datecontrol 设置,请参阅 http://demos.krajee.com/datecontrol#module
- 在您的
config/console.php中(这是迁移和与控制台一起工作所需的)
'modules'=>[ 'user-management' => [ 'class' => 'webvimark\modules\UserManagement\UserManagementModule', 'controllerNamespace'=>'vendor\webvimark\modules\UserManagement\controllers', // To prevent yii help from crashing ], ],
- 运行迁移
./yii migrate --migrationPath=vendor/webvimark/module-user-management/migrations/
有关用户管理设置,请参阅 https://github.com/webvimark/user-management
使用方法
转到您的 gii 工具,并注意新的 EasYii Gii 生成器用于模型 & CRUD
功能
模型
- 生成表示列(RepresentingColumn)
- 生成 CPF/CNPJ 验证器
- 生成电子邮件验证器
- 根据 DBMS 注释指定您的标签名称 / 属性,用于外键和字段
CRUD
- 生成所有 CRUD,使用表 (*) 的通配符
- 生成相关输入输出
- 导出到各种格式
- 在索引网格视图中展开/折叠相关数据行
- 带有/不带 TabularForms 的视图
- 日期(DateControl)的自定义字段
- 外键(Select2 和 RepresentingColumn)的自定义字段
- 基于 DBMS 操作的排除约束
- 添加安全模块(Yii 2 的用户管理模块)
- 输入文件(FileInput)的自定义字段
- 基于 RepresentingColumn 查看外键数据
迁移生成器
- 根据您的数据库结构生成迁移(基于:https://github.com/deesoft/yii2-gii)
我欢迎任何改进
感谢
- Jiwanndaru (jiwanndaru@gmail.com) 为创建传统
- kartik-v (https://github.com/kartik-v) 为大多数小部件
- schmunk42 (https://github.com/schmunk42) 为 bootstrap & 模型基础 & 扩展
- mdmunir (https://github.com/mdmunir) 为 JsBlock & 迁移生成器(来自 https://github.com/deesoft/yii2-gii)
- mootensai (https://github.com/mootensai) 为 yii2-enhanced-gii (https://github.com/mootensai/yii2-enhanced-gii)
- thtmorais (https://github.com/thtmorais/easyiigii)
开发者
- petersonsilvadejesus (https://github.com/petersonsilvadejesus)