Adds a message to the session

@param $type The type could be info, warning, success or error
@param $content The message

@return void
6181
public function addMessage($type, $content)
	{
		if($this->session->has('Cfmessage')) {
			$messages = $this->session->get('Cfmessage', []);
		}
		
		$messages[] = [
			'content' => $content,
			'type' => $type,
		];
		
		$this->session->set('Cfmessage', $messages);
	}
205315
public function setMessage($type, $content)
    {
        $message = new \stdClass;
        $message->mt = $type;
        $message->content = $content;
        $messages = $this->session()->get('messages', array());
        $messages[] = $message;
        $this->session()->set('messages', $messages);
    }
1246927
protected function addUserFlash(SessionInterface $session, $type, $message)
    {
        $session->getFlashBag()->add($type, $message);
    }
310623
public function addMessage($messages, $type = null)
    {
        switch ($type) {
            case 'success':
            case 'green':
                $tag = '<info>%s</info>';
                break;

            case 'warning':
            case 'yellow':
                $tag = '<comment>%s</comment>';
                break;

            case 'info':
            case 'blue':
                $tag = '<option>%s</option>';
                break;

            case 'error':
            case 'danger':
            case 'red':
                $tag = '<error>%s</error>';
                break;

            default:
                $tag = '%s';
                break;
        }

        foreach ((array) $messages as $message) {
            $time = gmdate('Y-m-d H:i:s');

            $this->out(sprintf('[%s] ' . $tag, $time, $message));
        }

        return $this;
    }
532035
protected function addMessage($message = '', $type = 'info')
    {
        $type = strip_tags($type);

        if (empty($message) || ! in_array($type, $this->types)) {
            return $this;
        }

        if ( ! array_key_exists($type, $_SESSION[$this->key])) {
            $_SESSION[$this->key][$type] = [];
        }

        $_SESSION[$this->key][$type][] = $message;

        return $this;
    }
471760
public function addType(Type $type)
    {
        $name = $type->getName();

        if (!Type::hasType($name)) {
            Type::addType($name, get_class($type));
        }

        $this->types[$name] = $type;
    }
1342590
public function enqueueMessage($msg, $type = 'message')
	{
		// For empty queue, if messages exists in the session, enqueue them first.
		if (!count($this->_messageQueue))
		{
			$session = JFactory::getSession();
			$sessionQueue = $session->get('application.queue');

			if (count($sessionQueue))
			{
				$this->_messageQueue = $sessionQueue;
				$session->set('application.queue', null);
			}
		}

		// Enqueue the message.
		$this->_messageQueue[] = array('message' => $msg, 'type' => strtolower($type));
	}
1120217
public static function addMessage($msg, string $type = 'danger', bool $postponed = false) {
		if (!$postponed) {
			if (is_array($msg)) {
				foreach ($msg as $k=>$v) {
					Application::set(['messages', $type], $v, ['append'=>true]);
				}
			} else {
				Application::set(['messages', $type], $msg, ['append'=>true]);
			}
		} else { // postponed messages go into session
			if (is_array($msg)) {
				foreach ($msg as $k=>$v) {
					Session::set(['numbers', 'messages', $type], $v, ['append'=>true]);
				}
			} else {
				Session::set(['numbers', 'messages', $type], $msg, ['append'=>true]);
			}
		}
	}
839170
protected function addFlashMessage($type, $transKey, $transOpts = array(), $domain = 'messages')
    {
        $this->get('session')
            ->getFlashBag()
            ->add(
                $type,
                $this->get('translator')->trans($transKey, $transOpts, $domain)
            );
    }
862193
public static function add(string $messageType, string $message): void
    {
        $_SESSION[self::SESSION_KEY][$messageType][] = $message;
    }
91159
public function chatSend($sender, $receiver, $content, $type = 'text') {
        $result = $this->httpPost(self::WECHAT_CHAT_SEND_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'receiver' => json_encode($receiver),
            'sender' => $sender,
            'msgtype' => $type,
            $type => json_encode($content),
        ]);
        return ($result['errmsg'] == 'ok') ? true : $result['errmsg'];
    }
1075578
public function notification($string, $type = null)
    {
        if (is_null($type)) {
            $type = 'info';
        }

        Session::flash('notification', $string);
        Session::flash('notificationType', 'alert-'.$type);
    }
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
50236
public function addMessage($message, $type) {
		if(!($this->session->get($this->sessionKey, [])) == null)
		{
			$messages = $this->session->get($this->sessionKey, []);
		}
		
		$messages[] = [
			'message' => $message,
			'type' => $type,
		];
		
		$this->session->set($this->sessionKey, $messages);
	}
1287044
public function add_notification( $id, $content, $type = null, $hide_button = null, $cond_func = null ) {
        if ( isset( $this->notices[$id] ) ) {
            return false;
        }

        if ( !$type ) {
            $type = 'success';
        }

        if ( !$hide_button ) {
            $hide_button = true;
        }

        if ( !$cond_func ) {
            $cond_func = false;
        }

        $this->notices[$id] = array(
            'id' => $id,
            'content' => $content,
            'type' => $type,
            'hide_button' => $hide_button,
            'cond_func' => $cond_func,
        );

        $this->save();
    }
970253
public function add($value, $type = 'n')
        {
            $this->session->put($type, $value);
            $this->session->push($this->key_name.'.new', $type);
            $this->removeFromOldFlashData([$type]);
        }
1237572
protected function addFlash(string $type, $message): void
    {
        (new Session())->getFlashBag()->set($type, $message);
    }