PHP 클래스 think\console\output\question\Choice

상속: extends think\console\output\Question
파일 보기 프로젝트 열기: top-think/framework

공개 메소드들

메소드 설명
__construct ( string $question, array $choices, mixed $default = null ) 构造方法
getChoices ( ) : array 可选项
getPrompt ( ) : string 获取提示
isMultiselect ( )
setErrorMessage ( string $errorMessage ) : self 设置错误提示信息
setMultiselect ( boolean $multiselect ) : self 设置可否多选
setPrompt ( string $prompt ) : self 设置提示

비공개 메소드들

메소드 설명
getDefaultValidator ( ) : callable 获取默认的验证方法

메소드 상세

__construct() 공개 메소드

构造方法
public __construct ( string $question, array $choices, mixed $default = null )
$question string 问题
$choices array 选项
$default mixed 默认答案

getChoices() 공개 메소드

可选项
public getChoices ( ) : array
리턴 array

getPrompt() 공개 메소드

获取提示
public getPrompt ( ) : string
리턴 string

isMultiselect() 공개 메소드

public isMultiselect ( )

setErrorMessage() 공개 메소드

设置错误提示信息
public setErrorMessage ( string $errorMessage ) : self
$errorMessage string
리턴 self

setMultiselect() 공개 메소드

设置可否多选
public setMultiselect ( boolean $multiselect ) : self
$multiselect boolean
리턴 self

setPrompt() 공개 메소드

设置提示
public setPrompt ( string $prompt ) : self
$prompt string
리턴 self