function JSMessageTestController::messageLinksWithSystemMessages

Same name in other branches
  1. 11.x core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php \Drupal\js_message_test\Controller\JSMessageTestController::messageLinksWithSystemMessages()

Displays links to show messages via JavaScript with messages from backend.

Return value

array Render array for links.

1 string reference to 'JSMessageTestController::messageLinksWithSystemMessages'
js_message_test.routing.yml in core/modules/system/tests/modules/js_message_test/js_message_test.routing.yml
core/modules/system/tests/modules/js_message_test/js_message_test.routing.yml

File

core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php, line 38

Class

JSMessageTestController
Test Controller to show message links.

Namespace

Drupal\js_message_test\Controller

Code

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.