Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass an entity to a FormType #40

Open
atchoukio opened this issue Jan 23, 2017 · 2 comments
Open

Pass an entity to a FormType #40

atchoukio opened this issue Jan 23, 2017 · 2 comments

Comments

@atchoukio
Copy link

How could I pass an entity to the FormType to populate a select list?

@jdeniau
Copy link
Member

jdeniau commented Jan 24, 2017

Hi,

We did not try to do this for now. I think the solution is to pass the array of choices in your form type and your entity the basic way Symfony propose.

You may need to create a custom DataTransformer.

If you manage to do something about it, I am very interested, it could improve the bundle and help other.

Thanks

@jdeniau
Copy link
Member

jdeniau commented Feb 2, 2017

Just for the record, I did a blog post some time ago about doing an autocomplete "the right way" : http://blog.mapado.com/symfony-autocomplete-form-collection-the-right-way/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants