Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Fixed QuestionHelper examples #3998

Merged
merged 1 commit into from
Jul 11, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put the output inside a code block.


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

Expand Down