How can I add a non-entity field to a Symfony 1.4 form ? For example: a checkbox in a movie adding form.
1 Answer
You can add it as any other widget to the form's widgetSchema. Of course you have to remember to also add a validator or the validation will fail with an unexpected field error.
Symfony is smart enough to ignore the field when persisting the object to the database.
1 Comment
Pedro Casado
didnt work for me if you use only the widget. you have to use both widget and validator to have access to the field on the post validator. thanks