Drupal is a registered trademark of Dries Buytaert

var_debugger

1 sites Security covered
View on drupal.org

Var Debugger is a lightweight Drupal module designed to assist developers in debugging variables with additional contextual information, such as file name, line number, and variable type. It provides an easy-to-use global function and a Twig extension to inspect data within both PHP scripts and Twig templates.

Features

Global Debugging Function (var_debugger)

Logs a variable’s type and value.
Displays the file and line number where the function was called.
Supports optional script termination after logging.
Uses Symfony VarDumper for better readability.

var_debugger($variable);
var_debugger($variable, TRUE); // Stops script execution after logging.

Twig Integration
Adds a custom Twig function var_debugger() for debugging inside templates.

{{ var_debugger($variable) }}
{{ var_debugger($variable, TRUE) }} // Stops script execution after logging.

Activity

Total releases
1
First release
Mar 2025
Latest release
11 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Mar 11, 2025