Requirements
1
Install via Composer
Run the following command in your project root. The To pin to the current major version:
--dev flag ensures it is added to require-dev and never installed in production environments.2
Register the bundle
- With Symfony Flex
- Without Flex (manual)
If you use Symfony Flex and install from Packagist, the recipe runs automatically and:
- Registers the bundle in
config/bundles.php - Creates
config/packages/dev/nowo_twig_inspector.yaml - Adds routes to
config/routes.yamlfordevandtest
3
Add the bundle routes
Skip this step if you used Symfony Flex — routes are already configured by the recipe.
config/routes.yaml, restricted to dev and test:4
(Optional) Run the install command
If the Flex recipe did not run (for example, when installing from a private repository or directly from Git), you can use the install command to generate the config file and update routes automatically:This creates
config/packages/dev/nowo_twig_inspector.yaml and updates config/routes.yaml if needed.Additional options:5
Verify the installation
Clear the cache and open your application:Open any page in the browser with the Symfony Web Profiler toolbar visible. You should see a
</> icon in the toolbar. Click it to open the Twig Inspector dropdown — if it appears, the bundle is installed correctly.For the full usage walkthrough (enabling the overlay, hovering, clicking), see the Quickstart.IDE integration
To enable click-to-open in your IDE, set theframework.ide option in your dev framework configuration. The bundle uses Symfony’s standard %%f (file path) and %%l (line number) placeholders.
