Class ChoiceQuestion
Represents a choice question.
-
Symfony\Component\Console\Question\Question
-
Symfony\Component\Console\Question\ChoiceQuestion
Methods summary
public
|
#
__construct( string $question, array $choices, mixed $default = null )
Constructor.
Parameters
- $question
- The question to ask to the user
- $choices
- The list of available choices
- $default
- The default answer to return
Overrides
|
public
array
|
#
getChoices( )
Returns available choices.
Returns available choices.
Returns
array
|
public
Symfony\Component\Console\Question\ChoiceQuestion
|
#
setMultiselect( boolean $multiselect )
Sets multiselect option.
When multiselect is set to true, multiple choices can be answered.
Parameters
Returns
|
public
boolean
|
#
isMultiselect( )
Returns whether the choices are multiselect.
Returns whether the choices are multiselect.
Returns
boolean
|
public
string
|
#
getPrompt( )
Gets the prompt for choices.
Gets the prompt for choices.
Returns
string
|
public
Symfony\Component\Console\Question\ChoiceQuestion
|
#
setPrompt( string $prompt )
Sets the prompt for choices.
Sets the prompt for choices.
Parameters
Returns
|
public
Symfony\Component\Console\Question\ChoiceQuestion
|
#
setErrorMessage( string $errorMessage )
Sets the error message for invalid values.
Sets the error message for invalid values.
The error message has a string placeholder (%s) for the invalid value.
Parameters
Returns
|
Methods inherited from Symfony\Component\Console\Question\Question
getAutocompleterValues(),
getDefault(),
getMaxAttempts(),
getNormalizer(),
getQuestion(),
getValidator(),
isAssoc(),
isHidden(),
isHiddenFallback(),
setAutocompleterValues(),
setHidden(),
setHiddenFallback(),
setMaxAttempts(),
setNormalizer(),
setValidator()
|