Skip to content

Commit

Permalink
[Console] Fixed QuestionHelper examples
Browse files Browse the repository at this point in the history
  • Loading branch information
florianv committed Jul 6, 2014
1 parent 1938c2f commit 97c3894
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/console/helpers/questionhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ from a predefined list::
$question = new ChoiceQuestion(
'Please select your favorite color (defaults to red)',
array('red', 'blue', 'yellow'),
'red'
0
);
$question->setErrorMessage('Color %s is invalid.');

Expand Down Expand Up @@ -109,9 +109,9 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult

$helper = $app->getHelperSet()->get('question');
$question = new ChoiceQuestion(
'Please select your favorite color (defaults to red)',
'Please select your favorite colors (defaults to red and blue)',
array('red', 'blue', 'yellow'),
'red'
'0,1'
);
$question->setMultiselect(true);

Expand All @@ -121,6 +121,9 @@ this use :method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setMult
Now, when the user enters ``1,2``, the result will be:
``You have just selected: blue, yellow``.

If the user does not enter anything, the result will be:
``You have just selected: red, blue``.

Autocompletion
~~~~~~~~~~~~~~

Expand Down

0 comments on commit 97c3894

Please sign in to comment.