PHPackages                             smtgr14/twig-debugbar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. smtgr14/twig-debugbar

ActiveLibrary[Templating &amp; Views](/categories/templating)

smtgr14/twig-debugbar
=====================

A Twig extension to provide access to PHP Debug Bar's rendering functions.

1.1.0(8y ago)02.0kMITPHPPHP &gt;=5.3.0

Since Jan 15Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Smtgr14/twig-debugbar)[ Packagist](https://packagist.org/packages/smtgr14/twig-debugbar)[ RSS](/packages/smtgr14-twig-debugbar/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

Twig Debug Bar
==============

[](#twig-debug-bar)

A simple [Twig](https://github.com/twigphp/Twig) extension to provide rendering functions for the [PHP Debug Bar](http://github.com/maximebf/php-debugbar). This extension loads the StandardDebugBar and provides the functions *dbg\_message*, *dbg\_renderHead*, and *dbg\_render* for Twig.

**Requirements:**

- [Twig 2](https://github.com/twigphp/Twig)
- [PHP Debug Bar](https://github.com/maximebf/php-debugbar)

Installation
------------

[](#installation)

```
composer require smtgr14/twig-debugbar

```

Example
-------

[](#example)

```
$twig = new Twig_Environment(new Twig_Loader_Filesystem('Views'));
$debugbarExtn = $debugbarExtn = new Dougfelton\TwigDebugBar\Extension('/Path'); // Relative assets path to your web directory e.g. /assets/debug/
$twig->addExtension($debugbarExtn);

$debugbar = $debugbarExtn->getDebugBar(); // Returns DebugBar for use with normal debugbar operations.
```

```

		{{ dbg_renderHead() }}

        {{ dbg_message(array)|raw }}

        {{ dbg_message('Something Wrong', 'error')|raw }}
		{{ dbg_render()|raw }}

```

Acknowledgement
---------------

[](#acknowledgement)

This extension is a minor update (for compatibility with Twig v2) of Mark Arneman's extension [found here](https://github.com/bearlikelion/twig-debugbar) and the changes made by Doug Felton.
My work was minimal, and if you find this extension useful the credit goes to Mark and Doug. All I added was the getDebugBar method to return the object to make the bar useful outside of just the template rendering and message methods.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~418 days

Total

2

Last Release

3035d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/799384?v=4)[Samuel Inman](/maintainers/Smtgr14)[@Smtgr14](https://github.com/Smtgr14)

---

Tags

php-debugbartwig-extensiontwigextensionPHP debug bar

### Embed Badge

![Health badge](/badges/smtgr14-twig-debugbar/health.svg)

```
[![Health](https://phpackages.com/badges/smtgr14-twig-debugbar/health.svg)](https://phpackages.com/packages/smtgr14-twig-debugbar)
```

###  Alternatives

[symfony/ux-twig-component

Twig components for Symfony

22017.2M313](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1636.5M115](/packages/symfony-ux-live-component)[tales-from-a-dev/twig-tailwind-extra

A Twig extension for Tailwind

36982.8k12](/packages/tales-from-a-dev-twig-tailwind-extra)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

1682.8k1](/packages/symfony-ux-toolkit)[umanit/twig-image-extension

An extension to facilitate the integration of responsive images' markup in Twig templates.

1043.8k](/packages/umanit-twig-image-extension)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

261.9k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
