You are here

public function TwigExtension::drupalDump in Twig Tweak 8

Same name and namespace in other branches
  1. 8.2 src/TwigExtension.php \Drupal\twig_tweak\TwigExtension::drupalDump()

Dumps information about variables.

1 call to TwigExtension::drupalDump()
TwigExtension::dd in src/TwigExtension.php
An alias for self::drupalDump().

File

src/TwigExtension.php, line 318

Class

TwigExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public function drupalDump($var) {
  $var_dumper = '\\Symfony\\Component\\VarDumper\\VarDumper';
  if (class_exists($var_dumper)) {
    call_user_func($var_dumper . '::dump', $var);
  }
  else {
    trigger_error('Could not dump the variable because symfony/var-dumper component is not installed.', E_USER_WARNING);
  }
}