public function setMessage($message, $type = 'info', $global = false)
    {
        //if ajax send back the message
        //in the header
        if ($this->getRequest()->isAjax()) {
            $this->getResponse()
            ->setHeader('X-Message', json_encode(array(
                'text' => AnTranslator::_($message),
                'type' => $type
            )));
        } else {
            $this->storeValue('message', array('type' => $type, 'message' => $message), $global);
        }
    }
public function setMessage($message, $type = 'info', $global = false)
    {
        //if ajax send back the message
        //in the header
        if ($this->getRequest()->isAjax()) {
            $this->getResponse()
            ->setHeader('X-Message', json_encode(array(
                'text' => AnTranslator::_($message),
                'type' => $type
            )));
        } else {
            $this->storeValue('message', array('type' => $type, 'message' => $message), $global);
        }
    }
public function setMessage ( $ message , $ type = 'info' , $ global = false ) { //if ajax send back the message //in the header if ( $ this -> getRequest ( ) -> isAjax ( ) ) { $ this -> getResponse ( ) -> setHeader ( 'X-Message' , json_encode ( array ( 'text' => AnTranslator :: _ ( $ message ) , 'type' => $ type ) ) ) ; } else { $ this -> storeValue ( 'message' , array ( 'type' => $ type , 'message' => $ message ) , $ global ) ; } }
Sets a message.

@param string $type    The message type
@param string $message The message text
@param bool   $global  A flag to whether store the message in the global queue or not
Sets a message .