CakePHP 脚手架问题

发布于 2024-07-18 12:06:43 字数 406 浏览 6 评论 0原文

我有一个连接表,它将用户表和通信表连接在一起。 我在 Cake 中建立了适当的关系。 当我在控制器中使用 var $scaffold; 时,一切都完美链接。 我可以双向查看、添加和编辑记录。 但是,当我通过 Bake 控制台删除 var $scaffold 功能并让 Baker 创建标准索引、查看、添加、编辑文件时,所有这些功能都消失了。

根据食谱手册,我的印象是,bake 会重新创建索引、查看、添加、编辑文件,就像 var $scaffold; 创建它们一样,从而允许我按照我认为合适的方式编辑它们。 我这个假设错了吗?

有没有办法查看脚手架渲染视图时生成的代码。 我了解脚手架模板,但我必须承认它们仍然超出我的知识基础。

顺便说一句,喜欢这个网站。

谢谢

I have a joins table which brings a users table and a Communications table together.
I have the appropriate relationships built in Cake.
When I use var $scaffold; in the controllers everything links up perfect. I can view, add, and edit records in both directions. However, when I remove the var $scaffold feature through the Bake console and let bake create the standard index, view, add, edit files all that capabillity goes away.

I was under the impression, from the cookbook manual, that bake would recreate the index, view, add, edit files exactly as var $scaffold; creates them thus allowing me to edit them as I see fit.
Am I wrong in this assumption?

Is there some way to see the code generated by scaffold when it renders a view. I know about the scaffold templates but I must admit they are still a little above my knowledge base yet.

Love the site by the way.

Thank You

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

墨小墨 2024-07-25 12:06:43

您是否单独烘焙 MVC 的每个组件? 如果是这样,当您烘焙控制器时,它会询问您是否要包含基本的 CRUD 操作(添加、编辑、查看、删除)。 之后,烘焙视图,它会询问您是否需要 CRUD 视图(如果我没记错的话,默认为“否”)。

Are you baking each component of the MVC individually? If so, when you're baking the controller it will ask you if you want to include the basic CRUD actions (add, edit, view, delete). After that, bake the view and it will ask you if you want the CRUD views (if I recall correctly this defaults to no).

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