yidashi 2016-04-05 14:15:39 11229次浏览 3条评论 3 3 0

gii在web下的用法就不提了,简单直接。

不过命令行下用gii可能会更方便快捷。

  • 生成模型:
php yii gii/model --ns=common\\models --tableName=hehe --modelClass=Hehe
  • 生成crud
php yii gii/crud --modelClass=common\\models\\Hehe --controllerClass=backend\\controllers\\HeheController --viewPath=@backend/views/hehe

...其他几种LZ不太常用就不写了,生成的时候都会出confirm信息,如果不需要的话可以加上--interactive=0参数。hehe需要替换成你实际的表名、模型名等。

以上。

觉得很赞
您需要登录后才可以评论。登录 | 立即注册