Selaa lähdekoodia

Merge pull request #1636 from michelsalib/patch-2

Add doc for boolean type
Thomas 12 vuotta sitten
vanhempi
commit
ba75dc066f
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      Resources/doc/reference/form_types.rst

+ 4 - 0
Resources/doc/reference/form_types.rst

@@ -294,6 +294,10 @@ sonata_type_boolean
 The ``boolean`` type is a specialized ``ChoiceType`` where the choices list is
 locked to 'yes' and 'no'.
 
+Note that for backward compatibility reasons, it will set your value to '1' for 'yes' and to '2' for 'no'.
+If you want to map to a boolean value, just set the option ``transform`` to true. For instance, you need
+to do so when mapping to a doctrine boolean.
+
 
 sonata_type_translatable_choice
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^