PHPackages                             knplabs/rad-url-generation - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. knplabs/rad-url-generation

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

knplabs/rad-url-generation
==========================

Simply auto-complete needed route parameters with existing ones.

v2.1.0(8y ago)75.9k3MITPHPPHP ~7.0

Since Mar 11Pushed 3y ago8 watchersCompare

[ Source](https://github.com/KnpLabs/rad-url-generation)[ Packagist](https://packagist.org/packages/knplabs/rad-url-generation)[ RSS](/packages/knplabs-rad-url-generation/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (8)Used By (0)

DEPRECATED
==========

[](#deprecated)

Unfortunately we decided to not maintain this project anymore ([see why](https://knplabs.com/en/blog/news-for-our-foss-projects-maintenance)). If you want to mark another package as a replacement for this one please send an email to .

Rapid Application Development : Url Generation
==============================================

[](#rapid-application-development--url-generation)

Simply auto-complete needed route parameters with existing ones.

[![Build Status](https://camo.githubusercontent.com/dc199acee4b6a7362f6bae1b1d1918cc6205cea0ee3c5859b86cd732fca0abe0/68747470733a2f2f7472617669732d63692e6f72672f4b6e704c6162732f7261642d75726c2d67656e65726174696f6e2e737667)](https://travis-ci.org/KnpLabs/rad-url-generation)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c4ead9590c1e3983514c74ea48db90fc8e12d79e40e08fe2ab7d79ac170d749b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4b6e704c6162732f7261642d75726c2d67656e65726174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/KnpLabs/rad-url-generation/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/d1ca885c005b603c94ba8724bc948266b6c3ab1b575ece44ede7f0ddeb27d355/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d75726c2d67656e65726174696f6e2f762f737461626c652e737667)](https://packagist.org/packages/knplabs/rad-url-generation) [![Total Downloads](https://camo.githubusercontent.com/0875b5de9d8aaecad23fc99be902b22f3c7562c23f3edef6298b71f1e76ad51a/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d75726c2d67656e65726174696f6e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/knplabs/rad-url-generation) [![Latest Unstable Version](https://camo.githubusercontent.com/2ac44e8f9fcf3328051a2c3bc786555f262a8186cf103a8311dddd2145ca7fe1/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d75726c2d67656e65726174696f6e2f762f756e737461626c652e737667)](https://packagist.org/packages/knplabs/rad-url-generation) [![License](https://camo.githubusercontent.com/8607e62ed48d30dd5a5a23bc75ffd7bdc80c0beff988010c55ef4b00f0334b0e/68747470733a2f2f706f7365722e707567782e6f72672f6b6e706c6162732f7261642d75726c2d67656e65726174696f6e2f6c6963656e73652e737667)](https://packagist.org/packages/knplabs/rad-url-generation)

Official maintainers:
=====================

[](#official-maintainers)

- [@Einenlum](https://github.com/Einenlum)

Installation
============

[](#installation)

```
composer require knplabs/rad-url-generation ~2.0
```

```
class AppKernel
{
    function registerBundles()
    {
        $bundles = array(
            //...
            new Knp\Rad\UrlGeneration\Bundle\UrlGenerationBundle(),
            //...
        );

        //...

        return $bundles;
    }
}
```

Usages
======

[](#usages)

Just continue to use former url generation, nothing changes concerning the implementation. The only change is you don't repeat current route parameters anymore.

Example 1
---------

[](#example-1)

Current route:

```
app_products_show:
    path: /shops/{shop}/products/{products}/
```

My current url is `/shops/12/products/345/`. I want to build again the same url. Should I repeat route parameters if it already is my current route?

Nope.

```
$router->generate('app_products_show');                                  // Returns /shops/12/products/345/
$router->generate('app_products_show', ['product' => 122]);              // Returns /shops/12/products/122/
$router->generate('app_products_show', ['shop' => 1]);                   // Returns /shops/1/products/345/
$router->generate('app_products_show', ['shop' => 1, 'product' => 122]); // Returns /shops/1/products/122/
```

Example 2
---------

[](#example-2)

Current route:

```
app_products_show:
    path: /shops/{shop}/products/{products}/
```

Current URL: `/shops/1/products/122/`

I want to build this URL

```
app_variant_show:
    path: /shops/{shop}/products/{products}/variants/{variant}/
```

I could execute:

```
$router->generate('app_variant_show', ['shop' => 1, 'product' => 122, 'variant' => 23]); // Returns /shops/1/products/122/variants/23/
```

But why should I repeat already existing parameters ?

```
$router->generate('app_variant_show', ['variant' => 23]); // Returns /shops/1/products/122/variants/23/
```

Works with
==========

[](#works-with)

- Router service : `$container->get('router')->generate('app_products_show')`.
- Controller shortcuts: `$this->generateUrl('app_products_show')` and `$this->redirectToRoute('app_products_show')`.
- Twig functions: `path('app_products_show')` or `url('app_products_show')`.
- Everything else using the Symfony router.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 61.5% 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 ~177 days

Recently: every ~253 days

Total

7

Last Release

3070d ago

Major Versions

v1.0.2 → v2.0.02016-03-03

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

v2.1.0PHP ~7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/202732?v=4)[KNP Labs](/maintainers/KnpLabs)[@KnpLabs](https://github.com/KnpLabs)

---

Top Contributors

[![PedroTroller](https://avatars.githubusercontent.com/u/1766827?v=4)](https://github.com/PedroTroller "PedroTroller (8 commits)")[![polc](https://avatars.githubusercontent.com/u/3513348?v=4)](https://github.com/polc "polc (2 commits)")[![alexpozzi](https://avatars.githubusercontent.com/u/8307861?v=4)](https://github.com/alexpozzi "alexpozzi (1 commits)")[![AntoineLelaisant](https://avatars.githubusercontent.com/u/4592355?v=4)](https://github.com/AntoineLelaisant "AntoineLelaisant (1 commits)")[![Djeg](https://avatars.githubusercontent.com/u/1638230?v=4)](https://github.com/Djeg "Djeg (1 commits)")

---

Tags

urlurirouterroutingradautocompletion

### Embed Badge

![Health badge](/badges/knplabs-rad-url-generation/health.svg)

```
[![Health](https://phpackages.com/badges/knplabs-rad-url-generation/health.svg)](https://phpackages.com/packages/knplabs-rad-url-generation)
```

PHPackages © 2026

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