messageLinks example


  public function messageLinksWithSystemMessages() {
    // Add PHP rendered messages to the page.     $messenger = \Drupal::messenger();
    $messenger->addStatus('PHP Status');
    $messenger->addWarning('PHP Warning');
    $messenger->addError('PHP Error');

    return $this->messageLinks();
  }

  /** * Displays links to show messages via JavaScript. * * @return array * Render array for links. */
  public function messageLinks() {
    $buttons = [];
    foreach (static::getMessagesSelectors() as $messagesSelector) {
      
Home | Imprint | This part of the site doesn't use cookies.