vardumper.module in VarDumper 7
Same filename and directory in other branches
Main module file for the vardumper module.
File
vardumper.moduleView source
<?php
/**
* @file
* Main module file for the vardumper module.
*/
/**
* Implements hook_permission().
*/
function vardumper_permission() {
return array(
'access vardumper information' => array(
'description' => t('Access vardumper information in block or Drupal messages.'),
'title' => t('Access vardumper information'),
'restrict access' => TRUE,
),
);
}
/**
* API function vardumper().
*
* @param mixed $var
* @param string $name
* @param string $type
*/
function vardumper($var, $name = '', $type = 'message') {
$service = 'vardumper_' . drupal_strtolower($type);
if (\Drupal::hasService($service)) {
\Drupal::service($service)
->dump($var, $name);
}
else {
\Drupal::service('vardumper_message')
->dump($var, $name);
}
}
/**
* API aliases.
*/
function vdp($var, $name = '', $type = 'message') {
vardumper($var, $name, $type);
}
/**
*
*/
function vardumperMessage($var, $name = '') {
vardumper($var, $name, 'message');
}
/**
*
*/
function vdpm($var, $name = '') {
vardumper($var, $name, 'message');
}
if (!function_exists('dump')) {
/**
*
*/
function dump($var, $name) {
vardumper($var, $name, 'message');
}
}
Functions
Name | Description |
---|---|
vardumper | API function vardumper(). |
vardumperMessage | |
vardumper_permission | Implements hook_permission(). |
vdp | API aliases. |
vdpm |