【发布时间】:2018-03-24 04:43:50
【问题描述】:
我找到了这个:"How to process nested json with FOSRestBundle and Symfony forms",但接受的回复是:"making an unmapped form and binding data manually using a form event"
在play 中,您可以写your own data binder,但对于大多数格式(xml,json,...),您可以根据Content-Type http 标头(@987654332 @ 不是强制性的 here 让它工作),有一些众所周知的数据绑定器可用(来自 Spring 或任何地方)。 A product can have a list of items,即便如此,you can bind the request body to a form automatically。
PHP/Symfony 还没有学习如何解决这个问题? 如果我在 php + symfonmy 中创建 API REST,我需要编写某种“解析器”,例如 this? 有人可以分享帖子的链接或解决此问题的示例吗?
PD:我使用 play 示例是因为我不是经验丰富的 Web 开发人员(PHP 较少),所以把它当作我的 mcve。
提前致谢。
【问题讨论】:
标签: php json symfony symfony-forms databinder