开发者

Symfony Edit Specific Related Records

I have an app that I have a model that supports multiple add开发者_开发知识库resses, but upfront I only want to allow the user to add/edit one address.

User
----
UserId

Address
----
UserId
Line1
...

I have the following to render the form for adding a new address, but how about existing records? What do I need to add to my configure method in the User form?

    $this->embedForm("address", new AddressForm());


Take a look at More with Symfony: Advanced Forms. This chapter outlines a good way to embed multiple forms when dealing with 1-to-many relationships and should more than cover explaining what you need to do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜