function DevelDumperManager::message

Same name and namespace in other branches
  1. 4.x src/DevelDumperManager.php \Drupal\devel\DevelDumperManager::message()

Sets a message with a string representation of a variable.

Parameters

mixed $input: The variable to dump.

string|null $name: The label to output before variable.

string $type: (optional) The message's type. Defaults to MessengerInterface::TYPE_STATUS.

string|null $plugin_id: (optional) The plugin ID. Defaults to NULL.

bool $load_references: (optional) If the input is an entity, load the referenced entities. Defaults to FALSE.

Overrides DevelDumperManagerInterface::message

File

src/DevelDumperManager.php, line 127

Class

DevelDumperManager
Manager class for DevelDumper.

Namespace

Drupal\devel

Code

public function message($input, ?string $name = NULL, $type = MessengerInterface::TYPE_STATUS, ?string $plugin_id = NULL, $load_references = FALSE) : void {
  if ($this->hasAccessToDevelInformation()) {
    $output = $this->export($input, $name, $plugin_id, $load_references);
    $this->messenger
      ->addMessage($output, $type, TRUE);
  }
}