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 c0daee9

Browse filesBrowse files
committed
minor #20586 [Console] Adding associative array (ThomasLandauer)
This PR was merged into the 6.4 branch. Discussion ---------- [Console] Adding associative array Page: https://symfony.com/doc/6.4/components/console/helpers/questionhelper.html#let-the-user-choose-from-a-list-of-answers Commits ------- b9e2005 [Console] Adding associative array
2 parents e5e62c4 + b9e2005 commit c0daee9
Copy full SHA for c0daee9

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-1
lines changed

‎components/console/helpers/questionhelper.rst

Copy file name to clipboardExpand all lines: components/console/helpers/questionhelper.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ but ``red`` could be set instead (could be more explicit)::
128128
$question = new ChoiceQuestion(
129129
'Please select your favorite color (defaults to red)',
130130
// choices can also be PHP objects that implement __toString() method
131-
['red', 'blue', 'yellow'],
131+
['red', 'blue', 'yellow'], // pass an associative array to display custom indices: [3 => 'red', 7 => 'blue']
132132
0
133133
);
134134
$question->setErrorMessage('Color %s is invalid.');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.