Browse Source

Merge pull request #1636 from michelsalib/patch-2

Add doc for boolean type
Thomas 12 years ago
parent
commit
ba75dc066f
1 changed files with 4 additions and 0 deletions
  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
 The ``boolean`` type is a specialized ``ChoiceType`` where the choices list is
 locked to 'yes' and 'no'.
 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
 sonata_type_translatable_choice
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^