allankaio / giitester
生成关系型(hasMany, hasOne, belongsTo, & nested)模型 & CRUD。
dev-main
2022-10-02 14:31 UTC
This package is auto-updated.
Last update: 2024-09-30 01:25:43 UTC
README
Gii Tester (Yii2 测试代码生成器) 与 PostgreSQL 的人关系
安装
安装此扩展的首选方式是通过 composer。
运行
composer require allankaio/giitester
或在您的 composer.json
文件的 require
部分添加
"allankaio/giitester": "^1"
。
配置
- 然后您必须将此参数添加到 config\params.php。
'testepath' => 'tests'
- 然后您必须在您的 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', ], ],
请参阅 http://demos.krajee.com/grid#module 上的 gridview 设置
请参阅 http://demos.krajee.com/datecontrol#module 上的 datecontrol 设置
- 在您的 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 查看外键数据
测试
- 生成表的全部测试
- 生成 CRUD 测试
- 生成数据类型测试
- 生成 Email/CPF 测试
迁移生成器
- 从您的数据库结构生成迁移(基于: 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)
开发者
- Allan Kaio Brito Macedo (https://github.com/AllanKaio21)