使用 Sonata Admin 处理 Doctrine json_array 字段 [英] Using Sonata Admin to work with Doctrine json_array fields
问题描述
是否有任何内置"方式可以使用 Sonata Admin 管理 Doctrine json_array
字段?
Is there any 'built in' way to administer Doctrine json_array
fields using Sonata Admin?
我在 Symfony/Sonata 文档(或代码)中找不到任何有用的文档(或相关代码),但我希望我错过了一些东西!
I can't find any useful documentation (or relevant code) in the Symfony / Sonata docs (or code), but I'm hoping that I missed something!
理想情况下,我希望看到序列化的键/值对,可以删除它们中的任何一个并添加一些新的,但我想我将不得不自己写...
Ideally I would like to see the serialised key/value pairs with a way to delete any of them and add some new ones, but I guess I'm going to have to write that up myself...
推荐答案
您使用 json_array
就像使用任何数组一样,因此您可以使用 收藏类型 或 奏鸣曲类型集合.我喜欢奏鸣曲类型会为您添加/删除 JavaScript.
You work with json_array
just like with any array so You can go with collection type or sonata type collection.
I like that sonata type takes care about add/delete JavaScript for You.
这篇关于使用 Sonata Admin 处理 Doctrine json_array 字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!