1

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 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.