function DebugExtension::getFunctions
File
- 
              core/
lib/ Drupal/ Core/ Template/ DebugExtension.php, line 26  
Class
- DebugExtension
 - A class providing Drupal Twig Debug extension.
 
Namespace
Drupal\Core\TemplateCode
public function getFunctions() : array {
  // Override Twig built in debugger when Symfony VarDumper is available to
  // improve developer experience.
  // @see \Twig\Extension\DebugExtension
  // @see \Symfony\Component\VarDumper\VarDumper
  if (class_exists(self::SYMFONY_VAR_DUMPER_CLASS)) {
    return [
      new TwigFunction('dump', [
        self::class,
        'dump',
      ], [
        'needs_context' => TRUE,
        'needs_environment' => TRUE,
        'is_variadic' => TRUE,
      ]),
    ];
  }
  return [];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.