我想为下面的用户角色收集建立一个单滴 dwon 菜单 :
class UserType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add( userRoles ,null, array( multiple =>false))
;
}
但我得到这个错误信息:
Expected an object, but got a collection. Did you forget to pass
"multiple=true" to an entity field?
任何想法如何使收藏无法多重选择?