Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] fix choice_label values #6282

Merged
merged 1 commit into from
Mar 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 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,7 @@ 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 tag labels will be discarded for radio or checkbox
inputs. You can also return ``false`` from the callable to discard only the label
of the processed tag.