lvxiaolin/autocode
Composer 安装命令:
composer require lvxiaolin/autocode
包简介
It is convenient and quick to use ORM mode to program and automatically generate and update get and set methods.
README 文档
README
我认为,你是一个代码艺术家,你追求代码的抽象和便捷的代码导航。 在此之前,在一些WEB开发中,你需要时不时翻阅数据库建表语句来寻找和确定字段,否则就有可能写错字段。比如:
if($User->password == md5($this->getParam('password'))){ //登录成功 }
你可能一不小心,$User->password 写错成了 $User->pass
//$User->password 写成了 $User->pass 导致BUG if($User->pass == md5($this->getParam('password'))){ //登录成功 }
你为此感到苦恼,你认为你的IDE不够智能。
autocode 代码生成器 解决了这个问题,让你码代码时,不再需要去翻阅数据库确认字段。像这样:
如何安装呢?
- 安装 autocode:
composer require lvxiaolin/autocode
- 生成或更新 get、set 代码:
php think autocode:update
到这里就已经完成了,如果你对以前写的 $User->password 想统一改成 $User->getPassword()
- 替换在此之前的属性写法为方法写法 (application代表应用目录)
php think autocode:replace -d application
遇到问题?
感谢你的使用和反馈。 Thank you for your use and look forward to your feedback.
Author:LvXiaolin 1974764328@qq.com
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-08-19