Skip to content

Commit 67e716b

Browse files
JarJakjaviereguiluz
authored andcommitted
Update choice_label docs to match given examples
1 parent 861f4a4 commit 67e716b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ more control::
1616
'no' => false,
1717
'maybe' => null,
1818
],
19-
'choice_label' => function ($choiceValue, $key, $value) {
20-
if ($value == $choiceValue) {
19+
'choice_label' => function ($value, $key, $choiceValue) {
20+
if (true === $value) {
2121
return 'Definitely!';
2222
}
2323

@@ -28,9 +28,9 @@ more control::
2828
},
2929
]);
3030

31-
This method is called for *each* choice, passing you the choice ``$value`` and the
32-
``$key`` from the choices array (``$index`` is related to `choice_value`_). This
33-
will give you:
31+
This method is called for *each* choice, passing you the ``$value`` and
32+
``$key`` from the choices array (additional ``$choiceValue`` is related to `choice_value`_).
33+
This will give you:
3434

3535
.. image:: /_images/reference/form/choice-example2.png
3636
:align: center

0 commit comments

Comments
 (0)