-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
ConsoleactionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)
Milestone
Description
As of 2.3, the DialogHelper::select
method accepts multiselect by using comma seperated values:
$dialog = $app->getHelperSet()->get('dialog');
$colors = array('red', 'blue', 'yellow');
$selected = $dialog->select(
$output,
'Please select your favorite color (default to red)',
$colors,
0,
false,
'Value "%s" is invalid',
true // multiselect support is disabled by default
);
$selectedColors = array_map(funtion($c) use ($colors) {
return $colors[$c];
}, $selected)
$output->writeln('You have just selected: ' . implode(', ', $selectedColors));
Now, when a user inputs 1,2
, the result will be "You have just selected: blue, yellow".
Metadata
Metadata
Assignees
Labels
ConsoleactionableClear and specific issues ready for anyone to take them.Clear and specific issues ready for anyone to take them.good first issueIdeal for your first contribution! (some Symfony experience may be required)Ideal for your first contribution! (some Symfony experience may be required)