Skip to content

Commit ac2214c

Browse files
committed
[Form] fix choice_label values
1 parent 6be4c20 commit ac2214c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

reference/forms/types/options/choice_label.rst.inc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ choice_label
44
.. versionadded:: 2.7
55
The ``choice_label`` option was introduced in Symfony 2.7.
66

7-
**type**: ``callable`` or ``string`` **default**: ``null``
7+
**type**: ``string``, ``bool``, ``callable`` or ``PropertyPath`` **default**: ``null``
88

99
Normally, the array key of each item in the ``choices`` option is used as the
1010
text that's shown to the user. The ``choice_label`` option allows you to take
@@ -48,3 +48,6 @@ If your choice values are objects, then ``choice_label`` can also be a
4848
'choices_as_values' => true,
4949
'choice_label' => 'displayName',
5050
));
51+
52+
If set to ``false``, all the label tags will be discarded. You can also return
53+
``false`` from the callable to handle each choice differently.

0 commit comments

Comments
 (0)