PHPackages                             bearlikelion/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. bearlikelion/twig-debugbar

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

bearlikelion/twig-debugbar
==========================

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

1.1.0(10y ago)310.4k3[1 PRs](https://github.com/bearlikelion/twig-debugbar/pulls)MITPHPPHP &gt;=5.3.0

Since Jul 3Pushed 3y ago1 watchersCompare

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

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

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

[](#twig-debug-bar)

A simple 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](https://github.com/fabpot/Twig)
- [PHP Debug Bar](http://github.com/maximebf/php-debugba)

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

[](#installation)

```
"require": {
	"bearlikelion/twig-debugbar": "dev-master",
}

```

Example
-------

[](#example)

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

```

		{{ dbg_renderHead() }}

        {{ dbg_message(array) }}

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

```

Debug Bar Assets
----------------

[](#debug-bar-assets)

I use nginx, and on the dev enviornment load the Debug Bar assets directly from the /vendor/ folder. This is because by default, Debug Bar's renderHead function returns the assets pointing to /vendor/maximebf...

Using a simple nginx location I forward all requests to the propery directory, if there's a demand I will provide an option to set the asset path in the constructor.

```
location ~* ^/vendor/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
	root /var/www/app; # /var/www/app/vendor
}
```

### 1.1 change

[](#11-change)

Allows the asset directory to be defined in the constructor relative to the web root.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~481 days

Total

2

Last Release

3847d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01d4559bff863b2e16ce21f595b3f031ce02c2b631aede3c70e4aa83e09b4aa7?d=identicon)[bearlikelion](/maintainers/bearlikelion)

---

Top Contributors

[![bearlikelion](https://avatars.githubusercontent.com/u/3298808?v=4)](https://github.com/bearlikelion "bearlikelion (11 commits)")

---

Tags

twigdebugextensionbar

### Embed Badge

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

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

###  Alternatives

[shoot/shoot

Shoot aims to make providing data to your templates more manageable

41229.9k2](/packages/shoot-shoot)[redant/twig-components

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)

PHPackages © 2026

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