Cake\Console\ConsoleIo::outputAs PHP Method

outputAs() public method

Change the output mode of the stdout stream
See also: Cake\Console\ConsoleOutput::outputAs()
public outputAs ( integer $mode ) : void
$mode integer The output mode.
return void
    public function outputAs($mode)
    {
        $this->_out->outputAs($mode);
    }

Usage Example

Example #1
0
 /**
  * Display the help in the correct format
  *
  * @param string $command The command to get help for.
  * @return int|bool
  */
 protected function _displayHelp($command)
 {
     $format = 'text';
     if (!empty($this->args[0]) && $this->args[0] === 'xml') {
         $format = 'xml';
         $this->_io->outputAs(ConsoleOutput::RAW);
     } else {
         $this->_welcome();
     }
     return $this->out($this->OptionParser->help($command, $format));
 }