PHPackages                             gatomontes/symfony-twig-route-tracer - 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. gatomontes/symfony-twig-route-tracer

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

gatomontes/symfony-twig-route-tracer
====================================

Symfony bundle that adds route trace anchors to Twig templates for IDE navigation.

v0.1.0(3w ago)02Apache-2.0PHPPHP &gt;=8.1

Since May 18Pushed 3w agoCompare

[ Source](https://github.com/gatomontes/symfony-twig-route-tracer)[ Packagist](https://packagist.org/packages/gatomontes/symfony-twig-route-tracer)[ RSS](/packages/gatomontes-symfony-twig-route-tracer/feed)WikiDiscussions main Synced 1w ago

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

Symfony Twig Route Tracer
=========================

[](#symfony-twig-route-tracer)

A DX package for Symfony + Twig projects.

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

[](#installation)

```
composer require gatomontes/symfony-twig-route-tracer:^0.1 --dev
```

Problem
-------

[](#problem)

Twig to controller navigation in PhpStorm is painful.

This package injects non-rendering route traces into Twig templates so IDE route navigation can be reused.

Example:

```
{% if false %}
    {# trace_route:start #}
    {% set __symfony_twig_route_tracer_app_organization_index = path('app_organization_index') %}
    {# trace_route:end #}
{% endif %}
```

The trace never executes at runtime.

Its purpose is IDE navigation.

Commands
--------

[](#commands)

Inject a single route:

```
php bin/console tracer:inject --route=app_organization_index
```

Preview a route injection without writing files:

```
php bin/console tracer:inject --route=app_organization_index --dry-run
```

Inject all routes:

```
php bin/console tracer:inject
```

Injection Rules
---------------

[](#injection-rules)

- additive
- idempotent
- no duplicates
- alphabetically sorted
- validates generated Twig before writing
- supports `--dry-run` previews for safe review

MVP Notes
---------

[](#mvp-notes)

- route resolution uses Symfony router metadata
- template resolution scans controller source for `$this->render('...')`
- template resolution also follows `renderView()` calls and local service/document-builder methods that contain Twig template literals
- injected traces use native Twig `path()` calls so IDEs can reuse Symfony route recognition
- traces are wrapped in `{% if false %}` so routes with required params never execute at runtime
- namespaced Twig templates such as `@Admin/foo.html.twig` are not supported yet

Known Limitations
-----------------

[](#known-limitations)

- template discovery is static and source-based; highly dynamic template selection may not be traced
- namespaced Twig template references such as `@Admin/foo.html.twig` are not resolved yet
- service traversal is limited to local project services and Twig template string literals

Goals
-----

[](#goals)

- Twig -&gt; controller navigation
- leverage existing Symfony route intelligence
- avoid custom IDE plugins
- MakerBundle integration

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance96

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c3d4456d4929db94418b45b462885d69a2e25adb02db3d69e8ceb828a17e7c2?d=identicon)[gatomontes](/maintainers/gatomontes)

---

Top Contributors

[![gatomontes](https://avatars.githubusercontent.com/u/34066936?v=4)](https://github.com/gatomontes "gatomontes (12 commits)")

### Embed Badge

![Health badge](/badges/gatomontes-symfony-twig-route-tracer/health.svg)

```
[![Health](https://phpackages.com/badges/gatomontes-symfony-twig-route-tracer/health.svg)](https://phpackages.com/packages/gatomontes-symfony-twig-route-tracer)
```

PHPackages © 2026

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