You are here

function WebformCivicrmPreProcess::setMessage in Webform CiviCRM Integration 8.5

Wrapper for \Drupal::messenger() Ensures we only set the message on the first page of the node display

Parameters

$message:

string $type:

4 calls to WebformCivicrmPreProcess::setMessage()
WebformCivicrmPreProcess::alterForm in src/WebformCivicrmPreProcess.php
Alter front-end of webforms: Called by hook_form_alter() when rendering a civicrm-enabled webform Add custom prefix. Display messages. Block users who should not have access. Set webform default values.
WebformCivicrmPreProcess::loadMemberships in src/WebformCivicrmPreProcess.php
Load existing membership information and display a message to members.
WebformCivicrmPreProcess::populateEvents in src/WebformCivicrmPreProcess.php
Check if events are open to registration and take appropriate action
WebformCivicrmPreProcess::showNotYouMessage in src/WebformCivicrmPreProcess.php
Displays the admin-defined message with "not you?" link to known contacts

File

src/WebformCivicrmPreProcess.php, line 833
Front-end form pre-processor.

Class

WebformCivicrmPreProcess

Namespace

Drupal\webform_civicrm

Code

function setMessage($message, $type = 'status') {
  if (empty($_POST)) {
    \Drupal::messenger()
      ->addStatus($message);
  }
}