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.
686686 {
687687 $builder
688688 ->add('task')
689- ->add('dueDate', null, array('mapped' => false))
689+ ->add('dueDate')
690+ ->add('agreeTerms', 'checkbox', array('mapped' => false))
690691 ->add('save', 'submit')
691692 ;
692693 }
@@ -696,11 +697,11 @@ the choice is ultimately up to you.
696697
697698 The field data can be accessed in a controller with::
698699
699- $form->get('dueDate ')->getData();
700+ $form->get('agreeTerms ')->getData();
700701
701702 In addition, the data of an unmapped field can also be modified directly::
702703
703- $form->get('dueDate ')->setData(new \DateTime() );
704+ $form->get('agreeTerms ')->setData(true );
704705
705706Final Thoughts
706707--------------
You can’t perform that action at this time.
0 commit comments