You are here

public function MessengerInterface::addWarning in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Messenger/MessengerInterface.php \Drupal\Core\Messenger\MessengerInterface::addWarning()

Adds a new warning message to the queue.

Parameters

string|\Drupal\Component\Render\MarkupInterface $message: (optional) The translated message to be displayed to the user. For consistency with other messages, it should begin with a capital letter and end with a period.

bool $repeat: (optional) If this is FALSE and the message is already set, then the message won't be repeated. Defaults to FALSE.

Return value

$this

1 method overrides MessengerInterface::addWarning()
Messenger::addWarning in core/lib/Drupal/Core/Messenger/Messenger.php
Adds a new warning message to the queue.

File

core/lib/Drupal/Core/Messenger/MessengerInterface.php, line 90

Class

MessengerInterface
Stores runtime messages sent out to individual users on the page.

Namespace

Drupal\Core\Messenger

Code

public function addWarning($message, $repeat = FALSE);