symfony2admingenerator / AvocodeFormExtensionsBundle

(old-legacy) Symfony2 form extensions for Admingenerator project (also working standalone!)
Other
48 stars 31 forks source link

Custom Many To Many and Select2 #159

Open ndoulgeridis opened 9 years ago

ndoulgeridis commented 9 years ago

Hello,

I have successfully created a form of type afe_select2_entity with 2 entities having many-to-many relationship by doing:

 $builder->add('foo', 'afe_select2_entity', array(
        'class' => 'Foo\FooBundle\Entity\Foo',
        'multiple' => true,
        'label' => 'field.foo',

    ));

Now I have following entities:

1) Category 2) CategoryHasType 3) Type

How now from category form type embed a form to select types from Type entity and has afe_select2_entity styling? (autocomplete and boxes with icon to remove on selection)