From 97c3894dd801a02f8af79925ea90b5fdfa1e6640 Mon Sep 17 00:00:00 2001 From: florianv Date: Sun, 6 Jul 2014 09:51:26 +0200 Subject: [PATCH] [Console] Fixed QuestionHelper examples --- components/console/helpers/questionhelper.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/console/helpers/questionhelper.rst b/components/console/helpers/questionhelper.rst index 0f1031392c1..2f756434edc 100644 --- a/components/console/helpers/questionhelper.rst +++ b/components/console/helpers/questionhelper.rst @@ -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.'); @@ -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); @@ -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 ~~~~~~~~~~~~~~