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 54f7979

Browse filesBrowse files
committed
minor #11016 Update choice_label docs to match given examples (JarJak)
This PR was submitted for the 4.2 branch but it was squashed and merged into the 3.4 branch instead (closes #11016). Discussion ---------- Update choice_label docs to match given examples Code, description and image in the example did not match. Commits ------- 67e716b Update choice_label docs to match given examples
2 parents 861f4a4 + 67e716b commit 54f7979
Copy full SHA for 54f7979

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.