ThinkPHP5


think\console\output\question\Choice
library\think\console\output\question\Choice.php at line 16

Class Choice

Question
└─Choice

public class Choice
extends Question


Constructor Summary
void

__construct(string question, array choices, mixed default)

构造方法

Method Summary
array

getChoices()

可选项

self

setMultiselect(bool multiselect)

设置可否多选

void

isMultiselect()

string

getPrompt()

获取提示

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

Constructor Detail

library\think\console\output\question\Choice.php at line 30

__construct

public void __construct(string question, array choices, mixed default)

构造方法

Parameters:
question - 问题
choices - 选项
default - 默认答案

Method Detail

library\think\console\output\question\Choice.php at line 43

getChoices

public array getChoices()

可选项


library\think\console\output\question\Choice.php at line 53

setMultiselect

public self setMultiselect(bool multiselect)

设置可否多选


library\think\console\output\question\Choice.php at line 61

isMultiselect

public void isMultiselect()

library\think\console\output\question\Choice.php at line 70

getPrompt

public string getPrompt()

获取提示


library\think\console\output\question\Choice.php at line 80

setPrompt

public self setPrompt(string prompt)

设置提示


library\think\console\output\question\Choice.php at line 92

setErrorMessage

public self setErrorMessage(string errorMessage)

设置错误提示信息


ThinkPHP5