@@ -106,7 +106,9 @@ any :doc:`existing form types </reference/form/types>` because they are too
106
106
different. Consider an application that wants to reuse in different forms the
107
107
following set of fields as the "postal address":
108
108
109
- .. TODO: illustration of the form field
109
+ .. raw :: html
110
+
111
+ <object data =" ../_images/form/form-custom-type-postal-address.svg" type =" image/svg+xml" ></object >
110
112
111
113
As explained above, form types are PHP classes that implement
112
114
:class: `Symfony\\ Component\\ Form\\ FormTypeInterface `, although it's more
@@ -177,10 +179,10 @@ in the postal address. For the moment, all fields are of type ``TextType``::
177
179
])
178
180
->add('city', TextType::class)
179
181
->add('state', TextType::class, [
180
- 'label' => 'State/Province/Region ',
182
+ 'label' => 'State',
181
183
])
182
184
->add('zipCode', TextType::class, [
183
- 'label' => 'ZIP/Postal Code',
185
+ 'label' => 'ZIP Code',
184
186
])
185
187
;
186
188
}
@@ -250,7 +252,7 @@ learn about all you can do with these options::
250
252
public function configureOptions(OptionsResolver $resolver)
251
253
{
252
254
// this defines the available options and their default values when
253
- // they are not configured explicitly when using the form
255
+ // they are not configured explicitly when using the form type
254
256
$resolver->setDefaults([
255
257
'allowed_states' => null,
256
258
'is_extended_address' => false,
@@ -417,10 +419,13 @@ by overriding the ``getBlockPrefix()`` method in ``PostalAddressType``. The
417
419
second part of the Twig block name (e.g. ``_row ``) defines which form type part
418
420
is being rendered (row, widget, help, errors, etc.)
419
421
420
- .. seealso ::
422
+ The article about form themes explains the
423
+ :ref: `form fragment naming rules <form-fragment-naming >` in detail. The
424
+ following diagram shows some of the Twig block names defined in this example:
425
+
426
+ .. raw :: html
421
427
422
- The article about form themes explains the
423
- :ref: `form fragment naming rules <form-fragment-naming >` in detail.
428
+ <object data =" ../_images/form/form-custom-type-postal-address-fragment-names.svg" type =" image/svg+xml" ></object >
424
429
425
430
.. caution ::
426
431
0 commit comments