0
我正在使用Symfony 2.6.1。如何在Sonata Admin中配置m2m關係?
實體配置:http://pastebin.com/rMkYHjkE
管理類:
class PlaceAdmin extends Admin
{
// Fields to be shown on create/edit forms
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
//other fields
->add('types', 'collection', array(
'type' => new PlaceType,
'allow_add' => true,
));
;
}
//other stuff
}
當我試圖編輯所選實體:
預期類型「的字符串參數, 的Symfony \分量\表\ ResolvedFormTypeInterface或 Symfony \ Component \ Form \ FormTypeInterface「, 」Syloc \ Bundle \ GooglePlacesBu ndle \實體\ PlaceType」給定