Symfony1.4 少数不保存的嵌入式表单之一
我有银行模型与相关的(一对多)电话、社交、服务、工作时间模型。它们都有 I18N 字段。
我使用 ahDoctrineEasyEmbeddedRelations 插件,因此如果我使用 echo $form 渲染表单,银行表单的渲染和保存效果很好。
但我需要手动渲染银行表单(echo $form['new_Phones'][0]['en']['value']
),这里我遇到了问题:
一切都在新的上保存得很好银行形式除了WorkingHours之外,但与其他模型肯定是相同的。然后在编辑表单上我只填写了银行字段。
我已经和这个问题斗争了两天了。有人可以帮我吗?
这是代码片段:
架构:http://pastie.org/2861044
表单类:http://pastie.org/2861072
表单模板:http://pastie.org/2861070
I have Bank model with related (one to many) Phone, Social, Service, WorkingHours models. All of them have I18N fields.
I use ahDoctrineEasyEmbeddedRelations
plugin so rendering and saving of Bank form work well if I render form with echo $form
.
But I need to render Bank form manually (echo $form['new_Phones'][0]['en']['value']
) and here I come to problems:
Everything saves well on new Bank form except WorkingHours but it is certainly the same as other models. And then on edit form I have only Bank fields filled in.
I've been fightint with this problem for two days now. Could someone help me, please?
Here is pieces of code:
schema: http://pastie.org/2861044
form classes: http://pastie.org/2861072
form template: http://pastie.org/2861070
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在工作时间。它只有一个字段,即 i18n。添加第二个非 i18n 字段是肮脏的黑客行为,但现在它可以工作了。我认为这是插件或 symfony 中的错误。
the problem was in WorkingHours. It had only one field wich was i18n. Adding second not i18n field is dirty hack but now it works. I think it's bug in plugin or in symfony.