You are here

protected function MessagesContext::getMessages in Better Messages 8

Retrieve current status messages.

Return value

array Array of current messages. It will either be a result of drupal_get_messages() or $this->messages should we already be beyond the phase of rendering status messages on the current page request

1 call to MessagesContext::getMessages()
MessagesContext::getRuntimeContexts in src/ContextProvider/MessagesContext.php
Gets runtime context values for the given context IDs.

File

src/ContextProvider/MessagesContext.php, line 78

Class

MessagesContext
Provides current Drupal status messages as a context.

Namespace

Drupal\better_messages\ContextProvider

Code

protected function getMessages() {
  return is_null($this->messages) ? drupal_get_messages(NULL, FALSE) : $this->messages;
}