function MessengerTrait::messenger
Same name in other branches
- 9 core/lib/Drupal/Core/Messenger/MessengerTrait.php \Drupal\Core\Messenger\MessengerTrait::messenger()
- 8.9.x core/lib/Drupal/Core/Messenger/MessengerTrait.php \Drupal\Core\Messenger\MessengerTrait::messenger()
- 11.x core/lib/Drupal/Core/Messenger/MessengerTrait.php \Drupal\Core\Messenger\MessengerTrait::messenger()
Gets the messenger.
Return value
\Drupal\Core\Messenger\MessengerInterface The messenger.
File
-
core/
lib/ Drupal/ Core/ Messenger/ MessengerTrait.php, line 33
Class
- MessengerTrait
- Provides a trait for the messenger service.
Namespace
Drupal\Core\MessengerCode
public function messenger() {
if (!isset($this->messenger)) {
$this->messenger = \Drupal::messenger();
}
return $this->messenger;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.