我有一个Sonata管理包的问题。当我想显示来自同一个外表的两个变量时,我只显示一个变量。我有这样的代码:
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('image', 'entity', array(
'class' => 'KayserPlatformBundle:ProductImage',
'property' => 'name',
'multiple' => true,
'label' => 'Nom Image'
))
->add('image', 'entity', array(
'class' => 'KayserPlatformBundle:ProductImage',
'property' => 'url',
'multiple' => true,
'label' => 'Url'
))
;
}
如何同时显示两者?
字段名(image)在组内必须唯一。