think\console\output\Question::__construct PHP Method

__construct() public method

构造方法
public __construct ( string $question, mixed $default = null )
$question string 问题
$default mixed 默认答案
    public function __construct($question, $default = null)
    {
        $this->question = $question;
        $this->default = $default;
    }

Usage Example

Beispiel #1
0
 /**
  * 构造方法
  * @param string $question 问题
  * @param array  $choices  选项
  * @param mixed  $default  默认答案
  */
 public function __construct($question, array $choices, $default = null)
 {
     parent::__construct($question, $default);
     $this->choices = $choices;
     $this->setValidator($this->getDefaultValidator());
     $this->setAutocompleterValues($choices);
 }
All Usage Examples Of think\console\output\Question::__construct