addMessage

@param string|array $message
@param string       $type
320273
public static function addMessage($message, $type = 'default')
    {
        if (is_array($message)) {
            foreach ($message as $msg) {
                static::addMessage($msg);
            }

            return;
        }

        try {
            $collector = static::getInstance();
        } catch (\UnexpectedValueException $e) {
            return;
        }

        $data = $collector['debug.messages'];

        if ($data === null) {
            $data = [];
        }

        $data[] = [
            'message' => $message,
            'type' => $type,
            'timestamp' => microtime(true),
        ];

        $collector['debug.messages'] = $data;
    }
1341351
protected function message($message = null, array $params = null, $type = 'message')
    {
        return is_array($params) ? strtr(isset($this->$type) ? $this->$type : $message, $params) : $message;
    }
453942
public function addMessage($message)
    {
        collect((array) $message)->each(function ($item) {
            collect($item)->flatten()->each(function ($flattened) {
                $this->messageList->push($flattened);
            });
        });
    }
63302
public function addMessage($m, $type = 'info')
    {
        if (!Any::isStr($m) || !Any::isStr($type)) {
            return;
        }

        $m = App::$Security->secureHtml($m);
        try {
            $mCollector = $this->bar->getCollector('messages');

            if (method_exists($mCollector, $type)) {
                $this->bar->getCollector('messages')->{$type}($m);
            }
        } catch (\Exception $e) {
        } // mute exceptions there
    }
626428
public function flashMessage($message, string $type = 'info'): stdClass
	{
		parent::flashMessage($message, $type);
		return $this->presenter->flashMessage($message, $type);
	}
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
633808
public function addNotice($message, ...$text): void
    {
        $this->add(self::TYPE_NOTICE, $message, ...$text);
    }
132613
public function addMessageNow($key, $message)
    {
        // Create Array for this key
        if (!isset($this->forNow[$key])) {
            $this->forNow[$key] = [];
        }

        // Push onto the array
        $this->forNow[$key][] = $message;
    }
332083
public function alterationMessage($message, $type = "")
    {
        if (!$this->supressOutput) {
            if (Director::is_cli()) {
                switch ($type) {
                    case "created":
                    case "changed":
                    case "repaired":
                        $sign = "+";
                        break;
                    case "obsolete":
                    case "deleted":
                        $sign = '-';
                        break;
                    case "notice":
                        $sign = '*';
                        break;
                    case "error":
                        $sign = "!";
                        break;
                    default:
                        $sign = " ";
                }
                $message = strip_tags($message);
                echo "  $sign $message\n";
            } else {
                switch ($type) {
                    case "created":
                        $class = "success";
                        break;
                    case "obsolete":
                        $class = "error";
                        break;
                    case "notice":
                        $class = "warning";
                        break;
                    case "error":
                        $class = "error";
                        break;
                    case "deleted":
                        $class = "error";
                        break;
                    case "changed":
                        $class = "info";
                        break;
                    case "repaired":
                        $class = "info";
                        break;
                    default:
                        $class = "";
                }
                echo "<li class=\"$class\">$message</li>";
            }
        }
    }
1068998
public function addSuccess($message, ...$text): void
    {
        $this->add(self::TYPE_SUCCESS, $message, ...$text);
    }
971964
public function flashMessage(
        $message,
        $type = FlashMessage::TYPE_SUCCESS,
        $method = FlashMessage::METHOD_APPEND
    ) {
        $message = new FlashMessage($message, $type, $method);
        $this->register($message);

        return $message;
    }
1172524
protected function notify($message, $type = 'info')
    {
        if ($this->notifier) {
            $messages = is_array($message) ? $message : [$message];
            foreach ($messages as $text) {
                if ($type === 'error') {
                    $this->notifier->error($text);
                } else {
                    $this->notifier->info($text);
                }
            }
        }

        return $this;
    }
702651
public function message($type, $message)
    {
        if ( $this->session->has('flashMessages') ) {
            $flashMessages = $this->session->get('flashMessages');
            $flashMessages[] = ['type' => $type, 'message' => $message];
            $this->session->set('flashMessages', $flashMessages);
        } else {
            $this->session->set('flashMessages', [['type' => $type, 'message' => $message]]);
        }
    }
728057
private function type($message, $type)
    {
        $this->type = $type;

        $this->message = $message;

        return $this;
    }
677334
private function populateMessages(array $messages, $type, $group)
    {
        foreach ($messages as $message) {
            $this->messages[] = ['message' => $message, 'type' => $type, 'group' => $group];
        }
    }
154490
public function addMessage($type, $message, $file = null, $file_details = null)
	{
		switch ($type)
		{
			case Output::FATAL:
				$this->fatals[] = new Message($type, $message, $file, $file_details);
				break;
			case Output::ERROR:
				$this->errors[] = new Message($type, $message, $file, $file_details);
				break;
			case Output::WARNING:
				$this->warnings[] = new Message($type, $message, $file, $file_details);
				break;
			case Output::NOTICE:
				$this->notices[] = new Message($type, $message, $file, $file_details);
				break;
			default:
				// TODO: Decide on this?
		}
	}
51034
public function setMessage($type, $message) {
		if (!$this->session->has('flashmsgs')) {
			$this->session->set('flashmsgs', array());
		}
		$temp = $this->session->get('flashmsgs');
		$temp[] = array('type' => $type, 'content' => $message);
		$this->session->set('flashmsgs', $temp);
	}