2017 © Pedro Peláez
 

library ci-scaffold

简易的代码脚手架,简化生成CRUD的操作

image

torvalds8462/ci-scaffold

简易的代码脚手架,简化生成CRUD的操作

  • Wednesday, March 28, 2018
  • by lideshun123
  • Repository
  • 1 Watchers
  • 2 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

一个脚手架快速生成工具

1 安装

2 使用

3 验证

4 源码解析

5 feature

安装

composer require torvalds8462/ci-scaffold, (*1)

使用

在入口文件平行的目录建立一个文件 artisan 可以随意命名, (*2)


include "./vendor/autoload.php";
use OutSource\Kernel\Application;
$option = [
    "basePath" => dirname(__FILE__),
    "driver" => 'CI',
];
$application = new Application($option);
$application->run();

然后cli到这个目录 php artisan 就看到了可用的命令界面, (*3)

1.1 现在支持的功能

modules
  modules:category  Create a category modules 创建分类模块
make
   make:controller  Create a controller   //创建一个控制器
   make:library     Create a library      //创建一个类库
   make:model       Create a model        //创建一个model
   make:scaffold    Create a full CRUD views for given model  //创建一个脚手架
   make:schema      Create a schema       //创建一个规则文件
publish
   publish:init     Publishes init base   //初始化CI框架需要的资源
   publish:layout   Publishes all template files   //导出css js 视图模板
1.2 配置

1.2.1 $option 中需要的配置, (*4)

  • basePath 根目录地址这个是必须存在的,指向项目的根目录地址
  • driver 框架驱动,现在只支持了CI
  • modules 模块的名称默认使用admin

1.2.2 创建控制器, (*5)

php artisan make:controller controller_name, (*6)

1.2.3 创建脚手架, (*7)

php artisan make:scaffold scaffold_name, (*8)

--option, (*9)

  1. tableName 指定表名, (*10)

  2. primary 指定主键, (*11)

  3. softdelete 指定软删除的键名, (*12)

  4. schema 指定规则名生成脚手架, (*13)

  5. timestamp 指定时间戳字段, (*14)

  6. rollback 回滚删除掉生成的脚手架, (*15)

    字段格式: (name html_type options), (*16)

    例如 age text, (*17)

    Enter validations:, (*18)

    required|max:20, (*19)

    多个验证规则用 | 链接,暂时支持的验证规则, (*20)

    1.2.4 验证规则, (*21)

  7. required 属性必须存在, (*22)

  8. max:20 属性最大不超过验证值, (*23)

  9. min:20 属性最小不超过验证值, (*24)

  10. number 该属性必须是数字, (*25)

  11. email 该属性必须是邮箱格式, (*26)

  12. ip 该属性必须是IP地址格式, (*27)

  13. string 该属性过滤掉所有特殊字符返回string, (*28)

1.2.5 html类型, (*29)

  1. text input text, (*30)

  2. textarea textarea, (*31)

  3. date 时间类型, (*32)

  4. file 可以上传多个图片的, (*33)

  5. fileOne 上传单图, (*34)

  6. radio 单选 支持radio,key,key 也可以支持 radio,name:value,name:value, (*35)

  7. select 选择框 支持select,key,key 也可以支持 select,name:value,name:value, (*36)

feature

还有好多需要做的功能

    1. 登录注册 分类 广告图 分类 常用的模块功能
    2. api快速生成

The Versions

28/03 2018

dev-master

9999999-dev

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

20/02 2018

v2.0

2.0.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

01/01 2018

v1.9

1.9.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

12/12 2017

v1.8

1.8.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

24/11 2017

v1.7

1.7.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

12/11 2017

v1.6

1.6.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

06/11 2017

v1.5

1.5.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

28/10 2017

v1.4

1.4.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

26/10 2017

v1.3

1.3.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

24/10 2017

v1.2

1.2.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

24/10 2017

v1.1

1.1.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包

22/10 2017

v1.0

1.0.0.0

简易的代码脚手架,简化生成CRUD的操作

  Sources   Download

MIT

The Requires

 

The Development Requires

by li deshun

脚手架 outsource 外包