Question
└─Choice
public class Choice
extends Question
Constructor Summary | |
---|---|
void | __construct(string question, array choices, mixed default) 构造方法 |
Method Summary | |
---|---|
array | 可选项 |
self | setMultiselect(bool multiselect) 设置可否多选 |
void | |
string | 获取提示 |
self | setPrompt(string prompt) 设置提示 |
self | setErrorMessage(string errorMessage) 设置错误提示信息 |
Methods inherited from think\console\output\Question | |
---|---|
__construct, getAutocompleterValues, getDefault, getMaxAttempts, getNormalizer, getQuestion, getValidator, isAssoc, isHidden, isHiddenFallback, setAutocompleterValues, setHidden, setHiddenFallback, setMaxAttempts, setNormalizer, setValidator |
public void __construct(string question, array choices, mixed default)
构造方法
public array getChoices()
可选项
public self setMultiselect(bool multiselect)
设置可否多选
public void isMultiselect()
public string getPrompt()
获取提示
public self setPrompt(string prompt)
设置提示
public self setErrorMessage(string errorMessage)
设置错误提示信息