Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MessageCommand.php

function MessageCommand::__construct

Constructs a MessageCommand object.

Parameters

string|\Drupal\Component\Render\MarkupInterface $message: The text of the message.

string|null $wrapper_query_selector: The query selector of the element to display messages in when they should be displayed somewhere other than the default. @see Drupal.Message.defaultWrapper()

array $options: The options passed to Drupal.message().add().

bool $clear_previous: If TRUE, previous messages will be cleared first.

File

core/lib/Drupal/Core/Ajax/MessageCommand.php, line 112

Class

MessageCommand
AJAX command for a JavaScript Drupal.message() call.

Namespace

Drupal\Core\Ajax

Code

public function __construct($message, $wrapper_query_selector = NULL, array $options = [], $clear_previous = TRUE) {
    $this->message = $message;
    $this->wrapperQuerySelector = $wrapper_query_selector;
    $this->options = $options;
    $this->clearPrevious = $clear_previous;
}
RSS feed
Powered by Drupal