src/FlashMessage.php
public function display($types = null, $return = false)
    {
        $html  = null;
        $types = $types ?: array_keys($this->config('types'));

        foreach ((array)$types as $type) {
            if (! $this->isValidType($type) || ($messages = $this->getMessages($type)) === null) {
                continue;
            }

            foreach ($messages as $message) {
                $html .= $this->formatMessage($message, $type);
            }

            $this->clear($type);
        }

        $html = sprintf($this->config('container'), $html);

        if ($return) {
            return $html;
        }

        echo $html;
    }
public function display($types = null, $return = false)
    {
        $html  = null;
        $types = $types ?: array_keys($this->config('types'));

        foreach ((array)$types as $type) {
            if (! $this->isValidType($type) || ($messages = $this->getMessages($type)) === null) {
                continue;
            }

            foreach ($messages as $message) {
                $html .= $this->formatMessage($message, $type);
            }

            $this->clear($type);
        }

        $html = sprintf($this->config('container'), $html);

        if ($return) {
            return $html;
        }

        echo $html;
    }
public function display ( $ types = null , $ return = false ) { $ html = null ; $ types = $ types ? : array_keys ( $ this -> config ( 'types' ) ) ; foreach ( ( array ) $ types as $ type ) { if ( ! $ this -> isValidType ( $ type ) || ( $ messages = $ this -> getMessages ( $ type ) ) === null ) { continue ; } foreach ( $ messages as $ message ) { $ html .= $ this -> formatMessage ( $ message , $ type ) ; } $ this -> clear ( $ type ) ; } $ html = sprintf ( $ this -> config ( 'container' ) , $ html ) ; if ( $ return ) { return $ html ; } echo $ html ; }
Display the messages

@param  string|array|null $types
@param  bool              $return
@return string
Display the messages