You are here

function twig_var_dump in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/lib/Twig/Extension/Debug.php \twig_var_dump()
1 string reference to 'twig_var_dump'
Twig_Extension_Debug::getFunctions in vendor/twig/twig/lib/Twig/Extension/Debug.php

File

vendor/twig/twig/lib/Twig/Extension/Debug.php, line 36

Code

function twig_var_dump(Twig_Environment $env, $context) {
  if (!$env
    ->isDebug()) {
    return;
  }
  ob_start();
  $count = func_num_args();
  if (2 === $count) {
    $vars = array();
    foreach ($context as $key => $value) {
      if (!$value instanceof Twig_Template) {
        $vars[$key] = $value;
      }
    }
    var_dump($vars);
  }
  else {
    for ($i = 2; $i < $count; ++$i) {
      var_dump(func_get_arg($i));
    }
  }
  return ob_get_clean();
}