symfony/symfony — pull request #6343 by fabpot (2012-12-14 08:06:22+00:00)
Title: [Console] Add ability to select values interactively

This is a slightly modified version of #5417

Adds ability to select from value list:

$values = array('One', 'Two', 'Three');
$pick = $this->getHelper('dialog')->select($output, 'Pick a bundle:', $values, 2, array(
'return' => 'value'
));
var_dump($pick);

... would give the following CLI output:

Pick a bundle:
0 One
1 Two
2 Three
> 1
string(3) "Two"