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);
            }
        }
    }