1生成活动记录
Model Generator
This generator generates an ActiveRecord class for the specified database table.
没什么可写的选择表名,设置命令空间就可以了
2 生成 CRUD 代码
CRUD Generator
This generator generates a controller and views that implement CRUD (Create, Read, Update, Delete) operations for the specified data model.
view是文件路径所以用/,@为绝对路径,前三个都是命名空间所以用\。
因为gii是在frontend下,所以生成backend中文件时要写好命名空间,否则就会生成到frontend中
生成的所有增删改查的代码
其中的一个页面index.php,包含搜索,查看
默认显示5个字段,search和其他字段都被注释了,还不错!明天继续看代码咯!