public static function add($strMessage, $strType, $strScope = TL_MODE)
{
if ($strMessage == '') {
return;
}
if (!in_array($strType, static::getTypes())) {
throw new \Exception("Invalid message type {$strType}");
}
\System::getContainer()->get('session')->getFlashBag()->add(static::getFlashBagKey($strType, $strScope), $strMessage);
}
/** * Add a message * * @param string $strMessage The message * @param string $strType The message type * * @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0. * Use Message::add() instead. */ protected function addMessage($strMessage, $strType) { @trigger_error('Using System::addMessage() has been deprecated and will no longer work in Contao 5.0. Use Message::add() instead.', E_USER_DEPRECATED); \Message::add($strMessage, $strType); }