Yii模型tbl_*创建TblUserController和tblUser View
我正在尝试遵循(松散地添加)博客教程“使用 Yii 构建博客系统” 。
我将 SQL 表称为 tbl_user tbl_role
等,如教程中所述,但控制器最终为 TblUserController
,视图文件夹称为 tblUser tblRole
。
在本教程中,只有模型采用表前缀,控制器和视图则不采用。
有些东西正在改变,但我不知道在哪里。似乎 Yii 正在添加某种命名约定,或者现有的命名约定是无序的。这可能是因为我正在 svn trunk 上工作。
有谁知道这是怎么回事,所以我可以保持在 Yii 标准之内?
I am trying to follow (loosely I might add) the blog tutorial, "Building a Blog System using Yii".
I call the SQL tables tbl_user tbl_role
etc as described in the tutorial but the controller ends up being TblUserController
and the view folder is called tblUser tblRole
.
In the tutorial only the models take the table prefix, the controller and view does not.
Something is changing and I don't know where. Seems Yii is adding some kind of naming convention or the naming convention present is out of order. It is probably because I am working off the svn trunk.
Does anyone know where this is going, so I can stay within the Yii standards?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Gii 时可以定义表前缀。在您的情况下,您需要将其设置为
tbl_
。然后它应该生成UserController
而不是TblUserController
。You can define table prefix when using Gii. In your case you need to set it to
tbl_
. Then it should generateUserController
instead ofTblUserController
.