Default value for entity backed Date field in Symfony2 Form Builder
问题 Okay, I've got the FormType described below. I use this Form class for both the create and edit forms. I decided to set a default date ( from_date and to_date below), using the data attribute in the options array. This does a great job of setting the default date, in fact, too good a job. It also overrides the existing date in the edit form, which is no good at all, really. How do I set a real 'default' value, as opposed to an 'always' value? <?php namespace TechPeople\InvoiceBundle\Form; use