public function write($text = '', $style = 'none') {
        if (is_array($text)) {
            $max = 0;

            foreach($text as $txt) {
                $max = max($max, strlen($txt));
            }

            $outline = str_repeat(' ', $max + 4);
            $this->writeln($outline, $style);

            foreach($text as $txt) {
                $len = strlen($txt);
                $pre_space  = str_repeat(' ', 2);
                $post_space = str_repeat(' ', $max + 2 - $len);
                $this->writeln($pre_space . $txt . $post_space, $style);
            }

            $this->writeln($outline, $style);
        }
        else {
            echo $this->applyStyle($text, $style);
        }
    }
public function write($text = '', $style = 'none') {
        if (is_array($text)) {
            $max = 0;

            foreach($text as $txt) {
                $max = max($max, strlen($txt));
            }

            $outline = str_repeat(' ', $max + 4);
            $this->writeln($outline, $style);

            foreach($text as $txt) {
                $len = strlen($txt);
                $pre_space  = str_repeat(' ', 2);
                $post_space = str_repeat(' ', $max + 2 - $len);
                $this->writeln($pre_space . $txt . $post_space, $style);
            }

            $this->writeln($outline, $style);
        }
        else {
            echo $this->applyStyle($text, $style);
        }
    }
public function write ( $ text = '' , $ style = 'none' ) { if ( is_array ( $ text ) ) { $ max = 0 ; foreach ( $ text as $ txt ) { $ max = max ( $ max , strlen ( $ txt ) ) ; } $ outline = str_repeat ( ' ' , $ max + 4 ) ; $ this -> writeln ( $ outline , $ style ) ; foreach ( $ text as $ txt ) { $ len = strlen ( $ txt ) ; $ pre_space = str_repeat ( ' ' , 2 ) ; $ post_space = str_repeat ( ' ' , $ max + 2 - $ len ) ; $ this -> writeln ( $ pre_space . $ txt . $ post_space , $ style ) ; } $ this -> writeln ( $ outline , $ style ) ; } else { echo $ this -> applyStyle ( $ text , $ style ) ; } }
Write a line or a group of lines to output

@param mixed $text can be string or an array of strings
@param mixed $style can be null, a style code as string or an array of strings.
Write a line or a group of lines to output