@@ -241,7 +241,7 @@ your controller::
241
241
'form' => $form->createView(),
242
242
));
243
243
}
244
-
244
+
245
245
.. caution ::
246
246
247
247
Be aware that the ``createView() `` method should be called *after * ``handleRequest ``
@@ -686,7 +686,7 @@ the documentation for each type.
686
686
is left blank. If you don't want this behavior, either
687
687
:ref: `disable HTML5 validation <book-forms-html5-validation-disable >`
688
688
or set the ``required `` option on your field to ``false ``::
689
-
689
+
690
690
->add('dueDate', 'date', array(
691
691
'widget' => 'single_text',
692
692
'required' => false
@@ -1128,6 +1128,23 @@ the choice is ultimately up to you.
1128
1128
));
1129
1129
}
1130
1130
1131
+ .. caution ::
1132
+
1133
+ When the name of your form class matches any of the built-in field types,
1134
+ your form might not be rendered correctly. A form
1135
+ ``AppBundle\\Form\\Type\\PasswordType `` to change a user password for
1136
+ instance will be mistaken for the built-in ``PasswordType `` field type and
1137
+ won't be rendered correctly. You can still use the class name of your choice
1138
+ by overriding the ``getBlockPrefix `` method of your form class::
1139
+
1140
+ public function getBlockPrefix()
1141
+ {
1142
+ return 'app_bundle_password';
1143
+ }
1144
+
1145
+ Read the chapter ":doc: `/cookbook/form/create_custom_field_type.html `" for
1146
+ more information.
1147
+
1131
1148
.. tip ::
1132
1149
1133
1150
When mapping forms to objects, all fields are mapped. Any fields on the
0 commit comments