function dpm

Same name in other branches
  1. 7.x-1.x devel.module \dpm()
  2. 4.x devel.module \dpm()

Wrapper for DevelDumperManager::message().

Prints a variable to the 'message' area of the page.

Uses Drupal\Core\Messenger\MessengerInterface::addMessage()

Parameters

mixed $input: An arbitrary value to output.

string|null $name: Optional name for identifying the output.

string $type: Optional message type see MessengerInterface, defaults to TYPE_STATUS.

bool $load_dependencies: Optional load dependencies if an entity is passed.

Return value

mixed The unaltered input value.

See also

\Drupal\devel\DevelDumperManager::message()

3 string references to 'dpm'
Debug::getFunctions in src/Twig/Extension/Debug.php
DevelDumperBase::getInternalFunctions in src/DevelDumperBase.php
Returns a list of internal functions.
DevelTwigExtensionTest::testDumpFunctionsRegistered in tests/src/Kernel/DevelTwigExtensionTest.php
Tests that the Twig dump functions are registered properly.

File

./devel.module, line 479

Code

function dpm(mixed $input, ?string $name = NULL, string $type = MessengerInterface::TYPE_STATUS, bool $load_dependencies = FALSE) : mixed {
    Drupal::service('devel.dumper')->message(input: $input, name: $name, type: $type, load_references: $load_dependencies);
    return $input;
}