diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index a5757116817..22b69947a4e 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -111,7 +111,7 @@ The ``choice_list`` option must be an instance of the ``ChoiceListInterface``. For more advanced cases, a custom class that implements the interface can be created to supply the choices. -With this option you can also allow float values to be selected as data. +With this option you can also allow float values to be selected as data. For example: .. code-block:: php @@ -119,9 +119,19 @@ With this option you can also allow float values to be selected as data. // ... $builder->add('status', 'choice', array( - 'choice_list' => new ChoiceList(array(1, 0.5), array('Full', 'Half')) + 'choice_list' => new ChoiceList(array(1, 0.5, 0.1), array('Full', 'Half', 'Almost empty')) )); +The ``status`` field created by the code above will be rendered as: + +.. code-block:: html + + + .. include:: /reference/forms/types/options/empty_value.rst.inc .. include:: /reference/forms/types/options/expanded.rst.inc