CraftCli\Command\Command::choice PHP Method

choice() public method

Give the user a single choice from an array of answers.
public choice ( string $question, array $choices, string $default = null, mixed $attempts = null, boolean $multiple = null ) : boolean
$question string
$choices array
$default string
$attempts mixed
$multiple boolean
return boolean
    public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null)
    {
        $question = new ChoiceQuestion($question, $choices, $default);
        $question->setMaxAttempts($attempts)->setMultiselect($multiple);
        return $this->output->askQuestion($question);
    }