public function setMessage($message, $type = 'info', $key = 'messages')
    {
        if ($message !== '') {

            $messages = (array) $this->get("$key.$type", array());

            if (!in_array($message, $messages)) {
                $messages[] = $message;
                $this->set("$key.$type", $messages);
            }
        }
    }
public function setMessage($message, $type = 'info', $key = 'messages')
    {
        if ($message !== '') {

            $messages = (array) $this->get("$key.$type", array());

            if (!in_array($message, $messages)) {
                $messages[] = $message;
                $this->set("$key.$type", $messages);
            }
        }
    }
public function setMessage ( $ message , $ type = 'info' , $ key = 'messages' ) { if ( $ message !== '' ) { $ messages = ( array ) $ this -> get ( "$key.$type" , array ( ) ) ; if ( ! in_array ( $ message , $ messages ) ) { $ messages [ ] = $ message ; $ this -> set ( "$key.$type" , $ messages ) ; } } }
Sets a message to be displayed to the user
@param string $message
@param string $type
@param string $key
Sets a message to be displayed to the user