function SystemMessage::doExecute

Set a system message.

Parameters

string $message: Message string that should be set.

string $type: Type of the message.

bool $repeat: (optional) TRUE if the message should be repeated.

File

src/Plugin/RulesAction/SystemMessage.php, line 92

Class

SystemMessage
Provides a 'Show a message on the site' action.

Namespace

Drupal\rules\Plugin\RulesAction

Code

protected function doExecute($message, $type, $repeat) {
    // @todo Should we do the sanitization somewhere else? D7 had the sanitize
    // flag in the context definition.
    $message = Xss::filterAdmin($message);
    $repeat = (bool) $repeat;
    $this->messenger
        ->addMessage(Markup::create($message), $type, $repeat);
}