Messenger
class Messenger implements MessengerInterface (View source)
The messenger service.
Properties
| protected FlashBagInterface | $flashBag | The flash bag. |
|
| protected KillSwitch | $killSwitch | The kill switch. |
Methods
Adds a new error message to the queue.
Adds a new message to the queue.
Adds a new status message to the queue.
Adds a new warning message to the queue.
Gets all messages.
Deletes all messages.
Deletes all messages of a certain type.
Gets all messages of a certain type.
Details
__construct(FlashBagInterface $flash_bag, KillSwitch $killSwitch)
Messenger constructor.
$this
addError(string|MarkupInterface $message, bool $repeat = FALSE)
Adds a new error message to the queue.
$this
addMessage(string|MarkupInterface $message, string $type = self::TYPE_STATUS, bool $repeat = FALSE)
Adds a new message to the queue.
The messages will be displayed in the order they got added later.
$this
addStatus(string|MarkupInterface $message, bool $repeat = FALSE)
Adds a new status message to the queue.
$this
addWarning(string|MarkupInterface $message, bool $repeat = FALSE)
Adds a new warning message to the queue.
string[][]|MarkupInterface[][]
all()
Gets all messages.
string[]|MarkupInterface[]
deleteAll()
Deletes all messages.
string[]|MarkupInterface[]
deleteByType(string $type)
Deletes all messages of a certain type.
string[]|MarkupInterface[]
messagesByType(string $type)
Gets all messages of a certain type.