Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67e716b

Browse filesBrowse files
JarJakjaviereguiluz
authored andcommitted
Update choice_label docs to match given examples
1 parent 861f4a4 commit 67e716b
Copy full SHA for 67e716b

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

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

Copy file name to clipboardExpand all lines: reference/forms/types/options/choice_label.rst.inc
+5-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.