public function page($messages, $type = 0)
    {
        if (\is_string($messages)) {
            $messages = (array) $messages;
        }

        if (!\is_array($messages) && !\is_callable($messages)) {
            throw new \InvalidArgumentException('Paged output requires a string, array or callback');
        }

        $this->startPaging();

        if (\is_callable($messages)) {
            $messages($this);
        } else {
            $this->write($messages, true, $type);
        }

        $this->stopPaging();
    }
public function page($messages, $type = 0)
    {
        if (\is_string($messages)) {
            $messages = (array) $messages;
        }

        if (!\is_array($messages) && !\is_callable($messages)) {
            throw new \InvalidArgumentException('Paged output requires a string, array or callback');
        }

        $this->startPaging();

        if (\is_callable($messages)) {
            $messages($this);
        } else {
            $this->write($messages, true, $type);
        }

        $this->stopPaging();
    }
public function page ( $ messages , $ type = 0 ) { if ( \ is_string ( $ messages ) ) { $ messages = ( array ) $ messages ; } if ( ! \ is_array ( $ messages ) && ! \ is_callable ( $ messages ) ) { throw new \ InvalidArgumentException ( 'Paged output requires a string, array or callback' ) ; } $ this -> startPaging ( ) ; if ( \ is_callable ( $ messages ) ) { $ messages ( $ this ) ; } else { $ this -> write ( $ messages , true , $ type ) ; } $ this -> stopPaging ( ) ; }
Page multiple lines of output.

The output pager is started

If $messages is callable, it will be called, passing this output instance
for rendering. Otherwise, all passed $messages are paged to output.

Upon completion, the output pager is flushed.

@param string|array|\Closure $messages A string, array of strings or a callback
@param int                   $type     (default: 0)
Page multiple lines of output .