File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -686,7 +686,8 @@ the choice is ultimately up to you.
686
686
{
687
687
$builder
688
688
->add('task')
689
- ->add('dueDate', null, array('mapped' => false))
689
+ ->add('dueDate')
690
+ ->add('agreeTerms', 'checkbox', array('mapped' => false))
690
691
->add('save', 'submit')
691
692
;
692
693
}
@@ -696,11 +697,11 @@ the choice is ultimately up to you.
696
697
697
698
The field data can be accessed in a controller with::
698
699
699
- $form->get('dueDate ')->getData();
700
+ $form->get('agreeTerms ')->getData();
700
701
701
702
In addition, the data of an unmapped field can also be modified directly::
702
703
703
- $form->get('dueDate ')->setData(new \DateTime() );
704
+ $form->get('agreeTerms ')->setData(true );
704
705
705
706
Final Thoughts
706
707
--------------
You can’t perform that action at this time.
0 commit comments