@@ -77,7 +77,7 @@ from a predefined list::
77
77
$question = new ChoiceQuestion(
78
78
'Please select your favorite color (defaults to red)',
79
79
array('red', 'blue', 'yellow'),
80
- 'red'
80
+ 0
81
81
);
82
82
$question->setErrorMessage('Color %s is invalid.');
83
83
@@ -109,9 +109,9 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
109
109
110
110
$helper = $app->getHelperSet()->get('question');
111
111
$question = new ChoiceQuestion(
112
- 'Please select your favorite color (defaults to red)',
112
+ 'Please select your favorite colors (defaults to red and blue )',
113
113
array('red', 'blue', 'yellow'),
114
- 'red '
114
+ '0,1 '
115
115
);
116
116
$question->setMultiselect(true);
117
117
@@ -121,6 +121,9 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
121
121
Now, when the user enters ``1,2 ``, the result will be:
122
122
``You have just selected: blue, yellow ``.
123
123
124
+ If the user does not enter anything, the result will be:
125
+ ``You have just selected: red, blue ``.
126
+
124
127
Autocompletion
125
128
~~~~~~~~~~~~~~
126
129
0 commit comments