Yii模型tbl_*创建TblUserController和tblUser View

发布于 2024-08-27 01:27:08 字数 413 浏览 1 评论 0原文

我正在尝试遵循(松散地添加)博客教程“使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱桃奶球 2024-09-03 01:27:08

使用 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 generate UserController instead of TblUserController.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文