You are here

public function VarDumperBlock::dump in VarDumper 7

Same name and namespace in other branches
  1. 8 modules/vardumper_block/src/VarDumper/VarDumperBlock.php \Drupal\vardumper_block\VarDumper\VarDumperBlock::dump()

File

modules/vardumper_block/src/VarDumper/VarDumperBlock.php, line 43
Contains Drupal\vardumper_block\VarDumper\VarDumperBlock.

Class

VarDumperBlock
The VarDumperBlock class.

Namespace

Drupal\vardumper_block\VarDumper

Code

public function dump($var, $name = '') {
  if (!$this
    ->hasPermission()) {
    return;
  }
  $html = $this
    ->getHeaders($name, $this
    ->getDebugInformation()) . $this
    ->getDebug($var);
  $this->session
    ->getFlashBag()
    ->add('vardumper', $html);
}