code/controller/response/response.php
public function addMessage($message, $type = self::FLASH_SUCCESS)
    {
        if (!is_string($message) && !(is_object($message) && method_exists($message, '__toString')))
        {
            throw new \UnexpectedValueException(
                'The flash message must be a string or object implementing __toString(), "'.gettype($message).'" given.'
            );
        }

        if(!isset($this->_messages[$type])) {
            $this->_messages[$type] = array();
        }

        $this->_messages[$type][] = $message;
        return $this;
    }
public function addMessage($message, $type = self::FLASH_SUCCESS)
    {
        if (!is_string($message) && !(is_object($message) && method_exists($message, '__toString')))
        {
            throw new \UnexpectedValueException(
                'The flash message must be a string or object implementing __toString(), "'.gettype($message).'" given.'
            );
        }

        if(!isset($this->_messages[$type])) {
            $this->_messages[$type] = array();
        }

        $this->_messages[$type][] = $message;
        return $this;
    }
public function addMessage ( $ message , $ type = self :: FLASH_SUCCESS ) { if ( ! is_string ( $ message ) && ! ( is_object ( $ message ) && method_exists ( $ message , '__toString' ) ) ) { throw new \ UnexpectedValueException ( 'The flash message must be a string or object implementing __toString(), "' . gettype ( $ message ) . '" given.' ) ; } if ( ! isset ( $ this -> _messages [ $ type ] ) ) { $ this -> _messages [ $ type ] = array ( ) ; } $ this -> _messages [ $ type ] [ ] = $ message ; return $ this ; }
Add a response message

Flash messages are self-expiring messages that are meant to live for exactly one request. They can be used
across redirects, or flushed at the end of the request.

@param  string $message The flash message
@param string  $type Message category type. Default is 'success'.
@throws \UnexpectedValueException
@return ControllerResponse
Add a response message