public function getMessage($type = null, $key = 'messages')
    {
        if (isset($type)) {
            $key .= ".$type";
        }

        $message = $this->get($key, array());
        $this->delete($key);
        return $message;
    }
public function getMessage($type = null, $key = 'messages')
    {
        if (isset($type)) {
            $key .= ".$type";
        }

        $message = $this->get($key, array());
        $this->delete($key);
        return $message;
    }
public function getMessage ( $ type = null , $ key = 'messages' ) { if ( isset ( $ type ) ) { $ key .= ".$type" ; } $ message = $ this -> get ( $ key , array ( ) ) ; $ this -> delete ( $ key ) ; return $ message ; }
Returns messages from the session
@param string $type
@param string $key
@return string|array
Returns messages from the session