8000 clarify the signature of the choice_value callable · symfony/symfony-docs@5cf83f6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5cf83f6

Browse files
backbone87weaverryan
authored andcommitted
clarify the signature of the choice_value callable
1 parent 60a10e8 commit 5cf83f6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ in HTML and submitted in the POST/PUT requests. You don't normally need to worry
1111
about this, but it might be handy when processing an API request (since you can
1212
configure the value that will be sent in the API request).
1313
14-
This can be a callable or a property path. See `choice_label`_ for similar usage.
15-
If ``null`` is used, an incrementing integer is used as the name.
14+
This can be a callable or a property path. If ``null`` is given, an incrementing
15+
integer is used as the value.
16+
17+
.. note::
18+
19+
In contrast to other choice options (e.g. `choice_label`_), the callable for
20+
the ``choice_value`` option takes as **only** argument the actual choice, which
21+
is also the value that gets passed to your model when submitting the form.
1622
1723
.. caution::
1824

0 commit comments

Comments
 (0)
0