You are here

public function Messenger::messagesByType in Drupal 8

Same name and namespace in other branches
  1. 9 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\Messenger

Code

public function messagesByType($type) {
  return $this->flashBag
    ->peek($type);
}