Skip to content

Commit

Permalink
[Form] fix choice_label values
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Feb 17, 2016
1 parent 6be4c20 commit ac2214c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reference/forms/types/options/choice_label.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ choice_label
.. versionadded:: 2.7
The ``choice_label`` option was introduced in Symfony 2.7.

**type**: ``callable`` or ``string`` **default**: ``null``
**type**: ``string``, ``bool``, ``callable`` or ``PropertyPath`` **default**: ``null``

Normally, the array key of each item in the ``choices`` option is used as the
text that's shown to the user. The ``choice_label`` option allows you to take
Expand Down Expand Up @@ -48,3 +48,6 @@ If your choice values are objects, then ``choice_label`` can also be a
'choices_as_values' => true,
'choice_label' => 'displayName',
));

If set to ``false``, all the label tags will be discarded. You can also return
``false`` from the callable to handle each choice differently.

0 comments on commit ac2214c

Please sign in to comment.