Symfony 1.4 sfguard插件相关表
我正在使用 sfguard 插件和 propel orm 使用 symfony 1.4 开发项目。我有一些与 sf_guard_user 表相关的表。我必须在管理界面上一起显示这些表格。但 sfguard 插件只允许添加一张名为 sfuserprofile 的表。当我创建这个表时,我可以从generator.yml访问这个表的列。
但我必须向数据库添加与用户相关的大量数据,例如位置、详细地址、电话号码,当然还有所有关联的表。我无法将它们全部存储在 sfuserprofile 表上。我创建了一些表,例如 user_profile、user_address_details、user_album_images 等。但是我无法将除 user_profile 表之外的所有这些表集成到生成器文件中。
我已将自述文件标记为红色,但找不到任何线索。是否可以向 sfguard 生成器文件添加另一个表列。
编辑:
解决方案是将目标表单类合并到用户配置文件表单类中。
I am developing project with symfony 1.4 using sfguard plugin and propel orm. I have some tables related to sf_guard_user table. I have to show these tables all together on admin interface. But sfguard plugin only allow adding one table which is named as sfuserprofile. When I created this table, I can reach the columns of this tables from generator.yml.
But I have to add so many data to database which is related to user such as location, detailed address, tel numbers and of course all of associated tables. I can not store all of them on sfuserprofile table. I have create some tables such as user_profile, user_address_details, user_album_images etc. But I could not integrate all of these tables except user_profile table to generator file.
I have red the read me file but I could not find any clues. Is it possible adding another table column to sfguard generator file.
Edit:
The solution is merging the target form classes in userprofile form class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用部分字段(在其前面使用
_
定义的字段)或在 sfGuardUser 模型中为要显示的每个字段定义 getter。更多信息 http://www.symfony-project.org/book/1_2/14 - 生成器(查找自定义字段
和部分字段
)。那是 symfony 1.2 文档。 symfony 1.4 中的某些内容有所不同,但其中的信息足以让您走上正确的道路。
Either use partials (fields defined with
_
in front of them) or define getters in you sfGuardUser model for each field you want to display. More information http://www.symfony-project.org/book/1_2/14-Generators (look forCustom Fields
andPartial Fields
).That is a symfony 1.2 documentation. Some of the things are different in symfony 1.4, but it's enough info there to get you going on the right track.