瀏覽代碼

Merge pull request #1636 from michelsalib/patch-2

Add doc for boolean type
Thomas 12 年之前
父節點
當前提交
ba75dc066f
共有 1 個文件被更改,包括 4 次插入0 次删除
  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
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^