PHPackages                             wexample/symfony-routing - 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. [Framework](/categories/framework)
4. /
5. wexample/symfony-routing

ActiveLibrary[Framework](/categories/framework)

wexample/symfony-routing
========================

Various helpers for Symfony routing

0.1.7(2w ago)02401MITPHPPHP &gt;=8.2

Since Jan 5Pushed 2w agoCompare

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

READMEChangelogDependencies (10)Versions (47)Used By (1)

symfony\_routing
================

[](#symfony_routing)

Version: 0.1.7

Various helpers for Symfony routing

Table of Contents
-----------------

[](#table-of-contents)

- [Suite Integration](#suite-integration)
- [Dependencies](#dependencies)
- [Versioning](#versioning)
- [License](#license)
- [Suite Integration](#suite-integration)
- [Suite Signature](#suite-signature)
- [Introduction](#introduction)
- [Usage](#usage)
- [Migration Notes](#migration-notes)

Integration in the Suite
------------------------

[](#integration-in-the-suite)

This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.

### Related Packages

[](#related-packages)

The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.

Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.

Dependencies
------------

[](#dependencies)

- php: &gt;=8.2
- wexample/symfony-helpers: &gt;=4.0.0
- wexample/symfony-template: &gt;=0.0.25

Versioning &amp; Compatibility Policy
-------------------------------------

[](#versioning--compatibility-policy)

Wexample packages follow **Semantic Versioning** (SemVer):

- **MAJOR**: Breaking changes
- **MINOR**: New features, backward compatible
- **PATCH**: Bug fixes, backward compatible

We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Free to use in both personal and commercial projects.

Integration in the Suite
------------------------

[](#integration-in-the-suite-1)

This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.

### Related Packages

[](#related-packages-1)

The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.

Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.

About us
========

[](#about-us)

[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.

This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.

Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.

wexample/symfony-routing
========================

[](#wexamplesymfony-routing)

Version: 0.0.21

Various helpers for Symfony routing

Table of Contents
-----------------

[](#table-of-contents-1)

Template-based route loader
===========================

[](#template-based-route-loader)

The bundle ships a Symfony route loader (`Wexample\SymfonyDesignSystem\Routing\TemplateBasedRouteLoader`) that scans controllers flagged with the `#[TemplateBasedRoutes]` attribute and auto-registers routes for each template file found in the controller directory.

How it works
------------

[](#how-it-works)

1. Controllers opt-in with the `#[TemplateBasedRoutes]` attribute. They usually extend `AbstractDesignSystemShowcaseController`(which inherits from `AbstractPagesController`) and may reuse `SymfonyDesignSystemBundleClassTrait` to declare the bundle that hosts their templates.
2. During the container compilation, `TemplateBasedRoutesTagCompilerPass` mirrors the attribute into a service tag (`has_template_routes`). The template loader receives a tagged iterator so it only processes relevant controllers and stays decoupled from the discovery logic.
3. When the loader runs, it figures out where to look for templates:
    - If the controller exposes a bundle via `getDefaultPageBundleClass()` (the trait does that), the loader resolves the bundle path and scans `Resources/views/...` for the controller.
    - Otherwise it falls back to the project root and scans the controller directory under `templates/`.
4. For each Twig template (`*.html.twig`) it finds, the loader builds a route name/path using the helpers from `AbstractPagesController`and wires the route to the controller method `resolveSimpleRoute`.

This means that adding a new page is as simple as dropping a Twig file in the controller directory: no manual route declaration is needed, the loader picks it up on the next cache warmup.

Typical setup
-------------

[](#typical-setup)

```
#[Route(path: DemoController::CONTROLLER_BASE_ROUTE.'"'"'/demo/'"'"', name: DemoController::CONTROLLER_BASE_ROUTE.'"'"'_demo_'"'"')]
#[TemplateBasedRoutes]
final class DemoController extends AbstractDesignSystemShowcaseController
{
    use SymfonyDesignSystemBundleClassTrait; // exposes the bundle for template lookup
}
```

```
# config/routes/design_system.yaml
template_routes:
    resource: .
    type: template_based_routes
```

The YAML snippet simply tells Symfony to call our custom loader; it does not affect discovery by itself.

Reusability considerations
--------------------------

[](#reusability-considerations)

The feature currently relies on the abstractions provided by this bundle (`AbstractPagesController`, bundle traits, etc.). If you need similar behavior elsewhere, factor those helpers out into a shared library before reusing the loader as-is. EOF'

Template-based route loader
===========================

[](#template-based-route-loader-1)

The bundle ships a Symfony route loader (`Wexample\SymfonyDesignSystem\Routing\TemplateBasedRouteLoader`) that scans controllers flagged with the `#[TemplateBasedRoutes]` attribute and auto-registers routes for each template file found in the controller directory.

How it works
------------

[](#how-it-works-1)

1. Controllers opt-in with the `#[TemplateBasedRoutes]` attribute. They usually extend `AbstractDesignSystemShowcaseController`(which inherits from `AbstractPagesController`) and may reuse `SymfonyDesignSystemBundleClassTrait` to declare the bundle that hosts their templates.
2. During the container compilation, `TemplateBasedRoutesTagCompilerPass` mirrors the attribute into a service tag (`has_template_routes`). The template loader receives a tagged iterator so it only processes relevant controllers and stays decoupled from the discovery logic.
3. When the loader runs, it figures out where to look for templates:
    - If the controller exposes a bundle via `getDefaultPageBundleClass()` (the trait does that), the loader resolves the bundle path and scans `Resources/views/...` for the controller.
    - Otherwise it falls back to the project root and scans the controller directory under `templates/`.
4. For each Twig template (`*.html.twig`) it finds, the loader builds a route name/path using the helpers from `AbstractPagesController`and wires the route to the controller method `resolveSimpleRoute`.

This means that adding a new page is as simple as dropping a Twig file in the controller directory: no manual route declaration is needed, the loader picks it up on the next cache warmup.

Typical setup
-------------

[](#typical-setup-1)

```
#[Route(path: DemoController::CONTROLLER_BASE_ROUTE.'/demo/', name: DemoController::CONTROLLER_BASE_ROUTE.'_demo_')]
#[TemplateBasedRoutes]
final class DemoController extends AbstractDesignSystemShowcaseController
{
    use SymfonyDesignSystemBundleClassTrait; // exposes the bundle for template lookup
}
```

```
# config/routes/design_system.yaml
template_routes:
    resource: .
    type: template_based_routes
```

The YAML snippet simply tells Symfony to call our custom loader; it does not affect discovery by itself.

Reusability considerations
--------------------------

[](#reusability-considerations-1)

The feature currently relies on the abstractions provided by this bundle (`AbstractPagesController`, bundle traits, etc.). If you need similar behavior elsewhere, factor those helpers out into a shared library before reusing the loader as-is.

Migration Notes
---------------

[](#migration-notes)

When upgrading between major versions, refer to the migration guides in the documentation.

Breaking changes are clearly documented with upgrade paths and examples.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance96

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Every ~7 days

Total

26

Last Release

18d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1240307?v=4)[Romain Weeger](/maintainers/weeger)[@weeger](https://github.com/weeger)

---

Top Contributors

[![weeger](https://avatars.githubusercontent.com/u/1240307?v=4)](https://github.com/weeger "weeger (95 commits)")

### Embed Badge

![Health badge](/badges/wexample-symfony-routing/health.svg)

```
[![Health](https://phpackages.com/badges/wexample-symfony-routing/health.svg)](https://phpackages.com/packages/wexample-symfony-routing)
```

###  Alternatives

[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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