Symfony\Component\Console\Helper\DialogHelper::select
Asks the user to select a value.
Signature
Parameters
$output
—
Symfony\Component\Console\Output\OutputInterface
- An Output instance
$question
—
object
- The question to ask
$choices
—
array
- List of choices to pick from
$default
—
object
- The default answer if the user enters nothing
$attempts
—
object
- Max number of times to ask before giving up (false by default, which means infinite)
$errorMessage
—
string
- Message which will be shown if invalid value from choice list would be picked
$multiselect
—
object
- Select more than one value separated by comma
Returns
- integer|string|array
- The selected value or values (the key of the choices array)
Errors/Exceptions
-
InvalidArgumentException