I have mysql 2 tables: user_profile_field and user_profile_data with following columns:
user_profile_field:
-id (integer)
-field (string)
-category(string)
user_profile_data:
-id (integer)
-user_id (integer)
-field_id (integer) references user_profile_field(id)
-data (string)
I also have defined 2 Doctrine entities that map this relation. I need dynamicaly to create a form for updating user_profile_data. The form input type for each row of user_profile_field depends on user_profile_field:category column (3 possible values correspond to different input types: text, textarea and choice field) ...
Im not sure how to create the form and form type entity via 'Symfony2' way ?
Any help or suggestion appreciated ...
The Symfony 2 user documentation suggests the use of form events to generate a dynamic form: http://symfony.com/doc/current/cookbook/form/dynamic_form_generation.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With