dragon8002 2017-04-20 04:52
浏览 188

在我更改mysql中的表字段(添加或更新)之后,我真的想用yii在yii中重新创建所有模型和CRUD工具吗?

Actually, i'm a laravel developer, recently moved to yii and i found gii was there. I can create models, controllers and CRUD facilities with gii... and that's great!

But if I a add more fields in a table or simple delete a field in a table I have to recreate model and controller with gii, otherwise it gives error. It's really taking my time. Is there any other way to do it, because I searched it and found nothing so far about it. People are suggesting command line, but using gii, is it possible?

  • 写回答

1条回答 默认 最新

  • doufei2662 2017-04-21 10:00
    关注

    Why don't you just create a gii model again, once a new field is added.By the looks of it if you do not want to write code again then gii will give an option to modify the existing files and add the fields on its own.Simple as that. But there is an disadvantage to this,if you have made some modifications as in for logic then that will get overridden once you modify the files using gii.But I suggested this because this fits in your business logic or as far as I can grasp it :p

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向