Description
Hello.
I did not used the form component for a while, So I may be wrong (but see this doc)
First, I pushed to code to ease understatement: lyrixx/symfony-standard@d203604
Basically, I create a form without data but with a data_class.
My "Entity" class have default values, So I expected to see the default values as the form default values. But instead, my form is empty:
If I inspect the HTML, I can see this (manually indented):
<form name="foo" method="post" action="">
<div id="foo">
<div>
<label for="foo_enabled" class="required">Enabled</label>
<input type="checkbox" id="foo_enabled" name="foo[enabled]" required="required" value="1" />
</div>
<div>
<label for="foo_name" class="required">Name</label>
<input type="text" id="foo_name" name="foo[name]" required="required" />
</div>
<input type="hidden" id="foo__token" name="foo[_token]" value="_Y4JKjDkfmIaaiAmtoOWDz6QQDpHLy0La2dtbzue2Q4" />
</div>
</form>
First you can note the value="1"
in the checkbox input.
Then, there is no value for the name.
I tried few symfony version from v2.6.3 to 2.7.6, it's always the same things.
So I tried to use empty_data
=> same result.
So, again, I tried to lower symfony requirement => same result for symfony 2.6.3
So I finally tried symfony 2.3 => and again, same result.
So, It could be nice to use the empty_data
option to populate the form