TYPO3
7.6
|
Public Member Functions | |
__construct ($question, array $choices, $default=null) | |
getChoices () | |
setMultiselect ($multiselect) | |
getPrompt () | |
setPrompt ($prompt) | |
setErrorMessage ($errorMessage) | |
Public Member Functions inherited from Question | |
__construct ($question, $default=null) | |
getQuestion () | |
getDefault () | |
isHidden () | |
setHidden ($hidden) | |
isHiddenFallback () | |
setHiddenFallback ($fallback) | |
getAutocompleterValues () | |
setAutocompleterValues ($values) | |
setValidator ($validator) | |
getValidator () | |
setMaxAttempts ($attempts) | |
getMaxAttempts () | |
setNormalizer ($normalizer) | |
getNormalizer () | |
Private Member Functions | |
getDefaultValidator () | |
Private Attributes | |
$choices | |
$multiselect = false | |
$prompt = ' > ' | |
$errorMessage = 'Value "%s" is invalid' | |
Additional Inherited Members | |
Protected Member Functions inherited from Question | |
isAssoc ($array) | |
Represents a choice question.
Definition at line 19 of file ChoiceQuestion.php.
__construct | ( | $question, | |
array | $choices, | ||
$default = null |
|||
) |
Constructor.
string | $question | The question to ask to the user |
array | $choices | The list of available choices |
mixed | $default | The default answer to return |
Definition at line 33 of file ChoiceQuestion.php.
References ChoiceQuestion\$choices, Question\$default, Question\$question, ChoiceQuestion\getDefaultValidator(), Question\setAutocompleterValues(), and Question\setValidator().
getChoices | ( | ) |
Returns available choices.
Definition at line 47 of file ChoiceQuestion.php.
References ChoiceQuestion\$choices.
|
private |
Returns the default answer validator.
Definition at line 115 of file ChoiceQuestion.php.
References ChoiceQuestion\$choices, ChoiceQuestion\$errorMessage, ChoiceQuestion\$multiselect, elseif, and Question\isAssoc().
Referenced by ChoiceQuestion\__construct(), ChoiceQuestion\setErrorMessage(), and ChoiceQuestion\setMultiselect().
getPrompt | ( | ) |
Gets the prompt for choices.
Definition at line 74 of file ChoiceQuestion.php.
References ChoiceQuestion\$prompt.
setErrorMessage | ( | $errorMessage | ) |
Sets the error message for invalid values.
The error message has a string placeholder (s) for the invalid value.
string | $errorMessage |
Definition at line 102 of file ChoiceQuestion.php.
References ChoiceQuestion\$errorMessage, ChoiceQuestion\getDefaultValidator(), and Question\setValidator().
setMultiselect | ( | $multiselect | ) |
Sets multiselect option.
When multiselect is set to true, multiple choices can be answered.
bool | $multiselect |
Definition at line 61 of file ChoiceQuestion.php.
References ChoiceQuestion\$multiselect, ChoiceQuestion\getDefaultValidator(), and Question\setValidator().
setPrompt | ( | $prompt | ) |
Sets the prompt for choices.
string | $prompt |
Definition at line 86 of file ChoiceQuestion.php.
References ChoiceQuestion\$prompt.
|
private |
Definition at line 21 of file ChoiceQuestion.php.
Referenced by ChoiceQuestion\__construct(), ChoiceQuestion\getChoices(), and ChoiceQuestion\getDefaultValidator().
|
private |
Definition at line 24 of file ChoiceQuestion.php.
Referenced by ChoiceQuestion\getDefaultValidator(), and ChoiceQuestion\setErrorMessage().
|
private |
Definition at line 22 of file ChoiceQuestion.php.
Referenced by ChoiceQuestion\getDefaultValidator(), and ChoiceQuestion\setMultiselect().
|
private |
Definition at line 23 of file ChoiceQuestion.php.
Referenced by ChoiceQuestion\getPrompt(), and ChoiceQuestion\setPrompt().