Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nowo-tech/TwigInspectorBundle/llms.txt

Use this file to discover all available pages before exploring further.

The overlay only works when it is both enabled and active (green).
  1. Click the </> icon in the toolbar to open the dropdown.
  2. Confirm the “Enable” checkbox is checked. If not, check it and wait for the page to reload.
  3. After reload, click the </> icon until it turns green.
  4. Move your mouse over the page content — you should now see the blue highlight and popup.
If the icon is not visible at all, see “Bundle not detected in toolbar” below.
The browser needs an IDE URL handler registered at the OS level, and Symfony must be told which URL format to use.
  1. Open (or create) config/packages/dev/framework.yaml.
  2. Add the framework.ide key with the URL for your IDE:
# config/packages/dev/framework.yaml
framework:
    ide: 'phpstorm://open?file=%%f&line=%%l'
  1. Clear the cache: php bin/console cache:clear.
  2. Try clicking an element again.
For all supported IDE URL strings, see IDE integration.
Template timing data comes from the Symfony Twig profiler, which is a separate component from the inspector overlay.
  • The overlay, template list, block list, and “open in IDE” functionality all work regardless of whether timing data is available.
  • If you want timing data, ensure twig.debug is true and that the Symfony WebProfilerBundle is active in the dev environment (it is by default in Symfony Flex projects).
Timing data is a diagnostic extra — the core inspector features do not depend on it.
This happens when the page’s main content is rendered as a fragment via {{ render(controller(...)) }}. By default the inspector only injects comments during the main request, so fragment-rendered templates appear as “sub-request” and are skipped.Enable injection on sub-requests:
# config/packages/dev/nowo_twig_inspector.yaml
nowo_twig_inspector:
    inject_on_sub_requests: true
Clear the cache and reload.
The bundle must be registered only for dev and test environments.
  1. Open config/bundles.php and confirm the entry is present:
Nowo\TwigInspectorBundle\NowoTwigInspectorBundle::class => ['dev' => true, 'test' => true],
  1. Clear the cache:
php bin/console cache:clear --env=dev
  1. Reload the page in the dev environment. The </> icon should appear in the Web Profiler toolbar.
Do not add 'prod' => true to the bundle registration. The inspector is a development tool only.
The bundle routes must be imported into your routing config under a when@dev guard.Check config/routes.yaml for the following block:
when@dev:
    nowo_twig_inspector:
        resource: '@NowoTwigInspectorBundle/Resources/config/routes.yaml'
If it is missing, add it (and a matching when@test block if needed), then clear the cache:
php bin/console cache:clear --env=dev
Alternatively, run the install command to have it added automatically:
php bin/console nowo:twig-inspector:install

Build docs developers (and LLMs) love