Download the PHP package nowo-tech/twig-inspector-bundle without Composer

On this page you can find all versions of the php package nowo-tech/twig-inspector-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twig-inspector-bundle

Twig Inspector Bundle

CI Packagist Version Packagist Downloads

Found this useful? Install from Packagist · Give it a star on GitHub 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

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

Installation

Install from Packagist

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

Manual registration in config/bundles.php:

Usage

  1. Enable the bundle (only in dev and test environments).
  2. Open your app in the browser with the Symfony Web Profiler toolbar visible.
  3. In the toolbar, find the </> icon (Twig Inspector) and open its dropdown.
  4. Enable the inspector: check the "Enable" checkbox, then reload the page.
  5. Turn on the overlay: click the </> icon so it turns green. Green = overlay on (hover shows highlight and popup). Yellow = overlay off.
  6. Move the mouse over the page: each element gets a blue highlight and a popup with the template name(s).
  7. Click an element to open that template in your IDE. Use the Filter field to limit by template name or path.

See docs/USAGE.md for the full step-by-step and overlay behavior.

Screenshots

Overlay tooltip (hover) Toolbar dropdown
DevTools: HTML comments

How it works

The bundle injects HTML comments before and after every Twig block and template. When the inspector is enabled, a JavaScript overlay maps those comments to HTML elements and lets you open the template in your IDE. With the inspector on, it also injects controller comments in the HTML (main controller after <body>, and start/end comments around each fragment from render(controller(...))). The Web Profiler panel shows templates, blocks, and controllers (with Main/Fragment roles). See docs/USAGE.md for details.

Configuration

The bundle works with no configuration file; defaults are defined in Configuration.php. Create config/packages/nowo_twig_inspector.yaml only if you want to customize behavior (exclusions, cookie name, overlay theme, etc.).

Full options and behavior: docs/CONFIGURATION.md.

IDE integration: set framework.ide in your config (e.g. phpstorm://open?file=%%f&line=%%l). Examples for PhpStorm, VS Code, Sublime, etc.: docs/INSTALLATION.md.

Documentation

Additional documentation

Security: The bundle validates template paths and restricts routes to dev/test. See docs/SECURITY.md.

Template usage metrics: When enable_metrics is true (default), the Web Profiler shows template/block usage. Details in docs/CONFIGURATION.md.

Requirements

See docs/UPGRADING.md for compatibility notes.

Demo

Three demos (Symfony 6.4, 7.0, 8.0) are in demo/symfony6, demo/symfony7, demo/symfony8. Each runs FrankenPHP (Caddy + PHP): the app listens on :80 inside the container, and docker-compose maps that to the host port PORT (defaults: 8001 for Symfony 6.4, 8002 for Symfony 7.0, 8003 for Symfony 8.0). Production-style configs use FrankenPHP worker mode; dev uses Caddyfile.dev without workers (see docs/DEMO.md.

Development

Run tests and QA with Docker: make up && make install && make test (or make test-coverage, make qa). Without Docker: composer install && composer test. Building assets: make assets (runs inside container) or pnpm install && pnpm run build. Full details: docs/DEVELOPMENT.md.

Tests and coverage

License

The MIT License (MIT). Please see LICENSE for more information.

Author

Created by Héctor Franco Aceituno at Nowo.tech

Based on Oro Twig Inspector by Oro, Inc.


All versions of twig-inspector-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1 <8.6
symfony/config Version ^6.0 || ^7.0 || ^8.0
symfony/console Version ^6.0 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.0 || ^7.0 || ^8.0
symfony/error-handler Version ^6.0 || ^7.0 || ^8.0
symfony/filesystem Version ^6.0 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.0 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.0 || ^7.0 || ^8.0
symfony/routing Version ^6.0 || ^7.0 || ^8.0
symfony/web-profiler-bundle Version ^6.0 || ^7.0 || ^8.0
twig/twig Version ^3.8 || ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nowo-tech/twig-inspector-bundle contains the following files

Loading the files please wait ...