Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc0daee9

Browse files
committed
minor#20586 [Console] Adding associative array (ThomasLandauer)
This PR was merged into the 6.4 branch.Discussion----------[Console] Adding associative arrayPage:https://symfony.com/doc/6.4/components/console/helpers/questionhelper.html#let-the-user-choose-from-a-list-of-answersCommits-------b9e2005 [Console] Adding associative array
2 parentse5e62c4 +b9e2005 commitc0daee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎components/console/helpers/questionhelper.rst

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp