Skip to content

output instance

Inhere edited this page Jan 10, 2019 · 2 revisions

输出实例

输出对象是 Inhere\Console\IO\Output 的实例

基本输出:

public function write(mixed $messages = '', $nl = true, $quit = false)
  • $messages mixed 要输出的消息。可以是字符串或数组。
  • $nl bool 输出后是否换行。 默认 true
  • $quit bool|int 输出后是否退出脚本。默认 false, 其它值都会转换为 int 作为退出码(true 会转换为 0)。
$output->write('hello');
$output->write(['hello', 'world']);
Clone this wiki locally