Skip to content

Commit d34edff

Browse files
committed
describe the allow_extra_fields form option
1 parent 561c6ee commit d34edff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

book/forms.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,15 @@ the choice is ultimately up to you.
10841084
->add('save', 'submit');
10851085
}
10861086

1087+
.. versionadded:: 2.6
1088+
The ``allow_extra_fields`` option was introduced in Symfony 2.6.
1089+
1090+
If you have many additional fields, this task may become tedious. Since Symfony
1091+
2.6, you can use the ``allow_extra_fields`` option when building the form
1092+
to ignore all extra fields::
1093+
1094+
$form = $this->createForm(new TaskType(), $task, array('allow_extra_fields' => true));
1095+
10871096
Additionally, if there are any fields on the form that aren't included in
10881097
the submitted data, those fields will be explicitly set to ``null``.
10891098

0 commit comments

Comments
 (0)