0
我會創建一個單一的降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?
任何想法如何使一個集合不能多選!