You are here

public function SessionTestController::setMessage in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::setMessage()

Sets a message to me displayed on the following page.

Return value

string A notification message.

1 call to SessionTestController::setMessage()
SessionTestController::setMessageButDontSave in core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php
Sets a message but call drupal_save_session(FALSE).
1 string reference to 'SessionTestController::setMessage'
session_test.routing.yml in core/modules/system/tests/modules/session_test/session_test.routing.yml
core/modules/system/tests/modules/session_test/session_test.routing.yml

File

core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php, line 117
Contains \Drupal\session_test\Controller\SessionTestController.

Class

SessionTestController
Controller providing page callbacks for the action admin interface.

Namespace

Drupal\session_test\Controller

Code

public function setMessage() {
  drupal_set_message($this
    ->t('This is a dummy message.'));
  return new Response($this
    ->t('A message was set.'));

  // Do not return anything, so the current request does not result in a themed
  // page with messages. The message will be displayed in the following request
  // instead.
}