public function Messenger::messagesByType in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Messenger/Messenger.php \Drupal\Core\Messenger\Messenger::messagesByType()
Gets all messages of a certain type.
Parameters
string $type: The messages' type. Either self::TYPE_STATUS, self::TYPE_WARNING, or self::TYPE_ERROR.
Return value
string[]|\Drupal\Component\Render\MarkupInterface[] The messages of given type.
Overrides MessengerInterface::messagesByType
File
- core/
lib/ Drupal/ Core/ Messenger/ Messenger.php, line 108
Class
- Messenger
- The messenger service.
Namespace
Drupal\Core\MessengerCode
public function messagesByType($type) {
return $this->flashBag
->peek($type);
}