2015-05-14 50 views
-1

如何選擇多個實體?多選。 Symfony表格

我的Symfony表單代碼

->add('typeContact', 'entity', array(
     'required'=>false, 
     'multiple' => true, 
     'expanded' => true, 
     'class' => 'App\MyBundle\Entity\TypeContact' 
    )) 

我得到這個結果,

enter image description here

但我想這種類型。

enter image description here

我怎樣才能得到這種類型。我嘗試expanded => false
任何人都可以幫忙嗎?

+0

這是使用select2 - https://select2.github.io/ – Andrew

回答