是否有可能使用sonata_type_collection
对自定义表单类型,而不是与其他实体的属性/关系?
事情是这样的:
$formMapper->add('foo', 'sonata_type_collection',
array('type' => new \myVendor\myBundleBundle\Form\Type\BlockType()
));
这引发了我下面的错误
The current field `contingut` is not linked to an admin. Please create one for the target entity : ``
编辑:
像这样的伎俩:
$formMapper->add('contingut', 'collection', array(
'type' => new \myVendor\myBundleBundle\Form\Type\Block1Type(),
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false
));