‪TYPO3CMS  10.4
TYPO3\CMS\Core\Messaging\FlashMessage Class Reference
Inheritance diagram for TYPO3\CMS\Core\Messaging\FlashMessage:
TYPO3\CMS\Core\Messaging\AbstractMessage

Public Member Functions

 __construct ($message, $title='', $severity=self::OK, $storeInSession=false)
 
bool isSessionMessage ()
 
 setStoreInSession ($storeInSession)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Messaging\AbstractMessage
string getTitle ()
 
 setTitle (string $title)
 
string getMessage ()
 
 setMessage (string $message)
 
int getSeverity ()
 
 setSeverity (int $severity=self::OK)
 
string __toString ()
 
array jsonSerialize ()
 

Protected Attributes

bool $storeInSession = false
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Messaging\AbstractMessage
string $title = ''
 
string $message = ''
 
int $severity = self::OK
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Core\Messaging\AbstractMessage
const NOTICE = -2
 
const INFO = -1
 
const OK = 0
 
const WARNING = 1
 
const ERROR = 2
 

Detailed Description

A class representing flash messages.

Definition at line 23 of file FlashMessage.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Messaging\FlashMessage::__construct (   $message,
  $title = '',
  $severity = self::OK,
  $storeInSession = false 
)

Constructor for a flash message

Parameters
string$message‪The message.
string$title‪Optional message title.
int$severity‪Optional severity, must be either of one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
bool$storeInSession‪Optional, defines whether the message should be stored in the session or only for one request (default)

Definition at line 39 of file FlashMessage.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\$message, TYPO3\CMS\Core\Messaging\AbstractMessage\$severity, TYPO3\CMS\Core\Messaging\AbstractMessage\$title, TYPO3\CMS\Core\Messaging\AbstractMessage\setMessage(), TYPO3\CMS\Core\Messaging\AbstractMessage\setSeverity(), TYPO3\CMS\Core\Messaging\FlashMessage\setStoreInSession(), and TYPO3\CMS\Core\Messaging\AbstractMessage\setTitle().

Member Function Documentation

◆ isSessionMessage()

bool TYPO3\CMS\Core\Messaging\FlashMessage::isSessionMessage ( )

Gets the message's storeInSession flag.

Returns
‪bool TRUE if message should be stored in the session, otherwise FALSE.

Definition at line 52 of file FlashMessage.php.

References TYPO3\CMS\Core\Messaging\FlashMessage\$storeInSession.

◆ setStoreInSession()

TYPO3\CMS\Core\Messaging\FlashMessage::setStoreInSession (   $storeInSession)

Sets the message's storeInSession flag

Parameters
bool$storeInSession‪The persistence flag

Definition at line 62 of file FlashMessage.php.

References TYPO3\CMS\Core\Messaging\FlashMessage\$storeInSession.

Referenced by TYPO3\CMS\Core\Messaging\FlashMessage\__construct().

Member Data Documentation

◆ $storeInSession

bool TYPO3\CMS\Core\Messaging\FlashMessage::$storeInSession = false
protected

Defines whether the message should be stored in the session (to survive redirects) or only for one request (default)

Definition at line 29 of file FlashMessage.php.

Referenced by TYPO3\CMS\Core\Messaging\FlashMessage\isSessionMessage(), and TYPO3\CMS\Core\Messaging\FlashMessage\setStoreInSession().