Silex-Routing provides advanced routing for Silex through connecting symfony-cmf/Routing with Silex.

Installs: 1 168

Dependents: 0

Suggesters: 0

Stars: 8

Watchers: 6

Forks: 1

Open Issues: 0

v1.0.6 2014-12-10 11:11 UTC


Serviceprovider for advanced and dynamic routing in Silex

Latest Stable Version Total Downloads License Build Status Coverage Status SensioLabsInsight


Silex-Routing allows you to define custom and multiple routers for Silex. This is especially useful when working with dynamic routes, which are not known while writing the code (e.g. URLs stored in database).

This implementation works for both, matching and generating of URLs.

The advanced routing is achieved by connecting Silex with symfony-cmf/Routing.


The recommended way to install Silex-Routing is through composer. Just create a composer.json file and run the php composer.phar install command to install it:

    "require": {
        "project-a/silex-routing": "~1.0"

Alternatively, you can download the file and extract it.


Using Silex-Routing is very simple. All you need to do is register the provided RoutingServiceProvider and afterwards add all your custom routers (RouterInterface).

$app = new Silex\Application();

$app->register(new SilexRouting\Provider\RoutingServiceProvider());

$router = new SilexRouting\SilexRouter($app); // e.g. The default Silex router


If you want to use url generation simple register the UrlGeneratorServiceProvider from this package and use generation as before.

$app->register(new SilexRouting\Provider\UrlGeneratorServiceProvider());

Do not use the Silex\Provider\UrlGeneratorServiceProvider together with Silex-Routing. Your custom routers will not be used!


To run the test suite, you need composer.

$ php composer.phar install --dev
$ phpunit


Silex-Routing is licensed under the MIT license.