CakePHP 脚手架问题
我有一个连接表,它将用户表和通信表连接在一起。 我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否单独烘焙 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).