2

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 
));
4

1 に答える 1