Download the PHP package quansitech/qscmf-curd-generator without Composer
On this page you can find all versions of the php package quansitech/qscmf-curd-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quansitech/qscmf-curd-generator
More information about quansitech/qscmf-curd-generator
Files in quansitech/qscmf-curd-generator
Informations about the package qscmf-curd-generator
qscmf-curd-generator
增删查改自动生成器
安装
用法
- 先创建数据库迁移文件
- 在迁移代码中设置表、字段注释,生成器根据注释自动生成对应的代码
注释格式
注释格式统一采用 @key=value; 的形式(最后的分号是格式的一部分)
如:设置字段title和type两个键值
@title=发布时间;@type=date;
注释类型
-
title
可用在表注释和字段注释中,表注释为必填,没有设置会报错
-
type
- select
表示该字段为外键,与另外一张表关联
必填配置值 (table 、 list的模式二选一)
table模式(通过另外一张表获取下来选项)
table 关联的表名
show 关联表的描述字段
样例代码
list模式(通过DBCont获取下拉列表)
list
DBCont中的变量名
如 Qscmf\Lib\DBCont 中的禁用启用项 $_status, 那么它的list就是 status
又如 Qscmf\Lib\DBCont 中的是否项 $_bool_status $_bool_status, 那么它的list就是 boolStatus
样例代码
-
radio
list模式(通过DBCont获取下拉列表)
list
DBCont中的变量名
如 Qscmf\Lib\DBCont 中的禁用启用项 $_status, 那么它的list就是 status
又如 Qscmf\Lib\DBCont 中的是否项 $_bool_status $_bool_status, 那么它的list就是 boolStatus
样例代码
-
checkbox
list模式(通过DBCont获取下拉列表)
list
DBCont中的变量名
如 Qscmf\Lib\DBCont 中的禁用启用项 $_status, 那么它的list就是 status
又如 Qscmf\Lib\DBCont 中的是否项 $_bool_status $_bool_status, 那么它的list就是 boolStatus
样例代码
-
date
日期类型 样例代码
-
file
单文件 样例代码
-
files
多文件 样例代码
-
picture
单图片(上传到服务器) 样例代码
-
pictures
多图片(上传到服务器) 样例代码
-
richText
富文本
默认使用imageproxy,如果使用oss,则可以加上@oss=true
样例代码
-
textarea
多行文本 样例代码
-
status
状态 (1 表示启用或者是 0 表示禁用或者否)
必填配置值
list
DBCont中的变量名
如 Qscmf\Lib\DBCont 中的禁用启用项 $_status, 那么它的list就是 status
又如 Qscmf\Lib\DBCont 中的是否项 $_bool_status $_bool_status, 那么它的list就是 boolStatus
样例代码
-
url
网址 样例代码
-
phone
手机号码
样例代码
-
email
邮箱地址
样例代码
-
district
中国省市区地址
样例代码
-
num
数字
样例代码
- length
设置字段长度限制, 第一个数字为最小长度, 第二个数字最大长度, 两个数字用逗号分隔
样例代码
-
save
设置字段是否可以在list页面进行快速修改
样例代码
目前支持save的类型有text、url、phone、email、num、select、date、textarea
-
require
字段是否必填
样例代码
生成命令
参数介绍
执行后会自动在app/Admin/Controller和app/Common/Model下分别生成controller和model
根据业务需要,可对文件自行二次开发
All versions of qscmf-curd-generator with dependencies
tiderjian/think-core Version >=13
quansitech/qscmf-buttontype-modal Version >=3