PHPackages                             nowo-tech/twig-inspector-bundle - 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. nowo-tech/twig-inspector-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

nowo-tech/twig-inspector-bundle
===============================

Debug Twig templates in the browser: visual overlay, click-to-open in IDE, Web Profiler. Symfony 6|7|8.

v1.0.26(1mo ago)12.1k↓28%[1 PRs](https://github.com/nowo-tech/TwigInspectorBundle/pulls)MITPHPPHP &gt;=8.1 &lt;8.6CI passing

Since Dec 12Pushed 1mo agoCompare

[ Source](https://github.com/nowo-tech/TwigInspectorBundle)[ Packagist](https://packagist.org/packages/nowo-tech/twig-inspector-bundle)[ Docs](https://github.com/nowo-tech/twig-inspector-bundle)[ GitHub Sponsors](https://github.com/HecFranco)[ RSS](/packages/nowo-tech-twig-inspector-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (32)Versions (28)Used By (0)

Twig Inspector Bundle
=====================

[](#twig-inspector-bundle)

[![CI](https://github.com/nowo-tech/TwigInspectorBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/TwigInspectorBundle/actions/workflows/ci.yml) [![Packagist Version](https://camo.githubusercontent.com/4a83ad0fac14de4abc7b084758ceaf0f924a448db0cc8bb830a7e1bcf34b426a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f747769672d696e73706563746f722d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/twig-inspector-bundle) [![Packagist Downloads](https://camo.githubusercontent.com/25e635414f9389e87ed134c90c333ae7db1560b95ce1b0be0bb2ecc89273d3e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f747769672d696e73706563746f722d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/twig-inspector-bundle) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![PHP](https://camo.githubusercontent.com/8e58b490725ac49cc8e463c473173681b324c9d92d7854275a785db013ca3de7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870)](https://php.net) [![Symfony](https://camo.githubusercontent.com/8fe7de83f11ab7ca74742794be56f9291632c8351a9ae5baea0bc1e9c4eb5a35/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d3625323025374325323037253230253743253230382d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com) [![GitHub stars](https://camo.githubusercontent.com/b5e3a67464abca4791d417cd6ae77a9c480be3298d255a094653bf24d7087920/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f747769672d696e73706563746f722d62756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/TwigInspectorBundle) [![Coverage](https://camo.githubusercontent.com/87c4ded1abb390166608ad46ddf61f5f0e8c382f8bf5ee3fc255e17a0290bb6e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d39392e36392532352d627269676874677265656e)](#tests-and-coverage)

> ⭐ **Found this useful?** [Install from Packagist](https://packagist.org/packages/nowo-tech/twig-inspector-bundle) · Give it a **star** on [GitHub](https://github.com/nowo-tech/TwigInspectorBundle) so more developers can find it.

**Twig Inspector Bundle** — Debug Twig templates directly in the browser. See which template or block rendered each HTML element, click to open it in your IDE, and use it from the Symfony Web Profiler. For Symfony 6, 7 and 8 · PHP 8.1+.

Table of contents
-----------------

[](#table-of-contents)

- [Quick search terms](#quick-search-terms)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Screenshots](#screenshots)
- [How it works](#how-it-works)
- [Configuration](#configuration)
- [Documentation](#documentation)
- [Requirements](#requirements)
- [Demo](#demo)
- [Development](#development)
- [License &amp; author](#license--author)

Quick search terms
------------------

[](#quick-search-terms)

Looking for **Twig debug**, **Twig inspector**, **Symfony template debug**, **template inspector**, **which template rendered this**, **Twig block finder**, **Web Profiler Twig**, **IDE open template**, **Twig development tool**? You're in the right place.

Features
--------

[](#features)

- ✅ Inspect Twig templates directly in the browser
- ✅ Visual overlay showing which templates render which HTML elements
- ✅ Click to open templates in your IDE
- ✅ Works with Symfony Web Profiler
- ✅ Cookie-based activation (no code changes needed)
- ✅ Supports nested blocks and templates
- ✅ **Configurable template/block exclusion** (with wildcard support)
- ✅ **Template usage metrics** in Web Profiler (templates, blocks, **controllers**)
- ✅ **Controllers in Profiler**: Main controller + fragments from `render(controller(...))` with Main/Fragment badges and render counts
- ✅ **Controller HTML comments** in page source when inspector is on (main + fragment boundaries)
- ✅ **Performance optimized** (skips processing when disabled)
- ✅ **Flexible configuration** for different use cases

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

[](#installation)

```
composer require nowo-tech/twig-inspector-bundle --dev
```

[![Install from Packagist](https://camo.githubusercontent.com/25ba1d8b573a14c09873ad1c973fe17a929432bcf6cf4ceca6fa0910e34c5d08/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d696e7374616c6c2d3737374242343f6c6f676f3d636f6d706f736572)](https://packagist.org/packages/nowo-tech/twig-inspector-bundle)

With **Symfony Flex**, the recipe registers the bundle and adds config/routes automatically. Without Flex, see [docs/INSTALLATION.md](docs/INSTALLATION.md) for manual steps.

**Manual registration** in `config/bundles.php`:

```
