PHPackages                             saxulum/saxulum-route-controller-provider - 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. saxulum/saxulum-route-controller-provider

AbandonedArchivedLibrary[Framework](/categories/framework)

saxulum/saxulum-route-controller-provider
=========================================

Saxulum Route/Controller Provider

1.3.0(10y ago)22.6k21MITPHPPHP &gt;=5.3.9,&lt;8.0

Since Jan 26Pushed 8y agoCompare

[ Source](https://github.com/saxulum-legacy/saxulum-route-controller-provider)[ Packagist](https://packagist.org/packages/saxulum/saxulum-route-controller-provider)[ RSS](/packages/saxulum-saxulum-route-controller-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (16)Used By (1)

saxulum-route-controller-provider
=================================

[](#saxulum-route-controller-provider)

**works with plain silex-php**

[![Build Status](https://camo.githubusercontent.com/9fa272e192714568bec2f39cfad5c6a1d21dc2159bc2abf5a63093b5354251c8/68747470733a2f2f6170692e7472617669732d63692e6f72672f736178756c756d2f736178756c756d2d726f7574652d636f6e74726f6c6c65722d70726f76696465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/saxulum/saxulum-route-controller-provider)[![Total Downloads](https://camo.githubusercontent.com/872f656f04d8ed657e9ecfd487787eeaeb16bf842f633b76de1ad9f8fa891a11/68747470733a2f2f706f7365722e707567782e6f72672f736178756c756d2f736178756c756d2d726f7574652d636f6e74726f6c6c65722d70726f76696465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/saxulum/saxulum-route-controller-provider)[![Latest Stable Version](https://camo.githubusercontent.com/9518dbc680cde35554e6dfa697caaac62059b9999fc11a1ddc51c952f290d5c4/68747470733a2f2f706f7365722e707567782e6f72672f736178756c756d2f736178756c756d2d726f7574652d636f6e74726f6c6c65722d70726f76696465722f762f737461626c652e706e67)](https://packagist.org/packages/saxulum/saxulum-route-controller-provider)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/af6eda519d60c3ee30f7ab65078f7bfcbe223f628791667c795a64827bfb4706/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736178756c756d2f736178756c756d2d726f7574652d636f6e74726f6c6c65722d70726f76696465722f6261646765732f7175616c6974792d73636f72652e706e673f733d36353339653538393263633936356566383261633865633932393434326335343461346530326135)](https://scrutinizer-ci.com/g/saxulum/saxulum-route-controller-provider/)

Features
--------

[](#features)

- Register Controller as Service using Annotations

Requirements
------------

[](#requirements)

- php &gt;=5.3
- Doctrine Annotations &gt;=1.1
- PHP Parser &gt;=0.9,&lt;1.0
- Saxulum ClassFinder &gt;=1.0
- Symfony Finder Component &gt;=2.3
- Silex &gt;= 1.1

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

[](#installation)

Through [Composer](http://getcomposer.org) as [saxulum/saxulum-route-controller-provider](https://packagist.org/packages/saxulum/saxulum-route-controller-provider).

### AnnotationRegistry

[](#annotationregistry)

Add this line after you added the `autoload.php` from composer

```
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(
    array($loader, 'loadClass')
);

```

### With defined cache dir

[](#with-defined-cache-dir)

```
use Saxulum\RouteController\Provider\RouteControllerProvider;
use Silex\Provider\ServiceControllerServiceProvider;

$app->register(new ServiceControllerServiceProvider());
$app->register(new RouteControllerProvider(), array(
    'route_controller_cache' => '/path/to/cache/'
));

```

- `debug == true`: the cache file will be build at each load
- `debug == false`: the cache file will be build if not exists, delete it if its out of sync

### Without defined cache dir

[](#without-defined-cache-dir)

probably slower, cause temp dir cleanups

```
use Saxulum\RouteController\Provider\RouteControllerProvider;
use Silex\Provider\ServiceControllerServiceProvider;

$app->register(new ServiceControllerServiceProvider());
$app->register(new RouteControllerProvider());

```

- `debug == true`: the cache file will be build at each load
- `debug == false`: the cache file will be build if not exists, delete it if its out of sync

### Add the controller paths

[](#add-the-controller-paths)

```
$app['route_controller_paths'] = $app->share(
    $app->extend('route_controller_paths', function ($paths) {
        $paths[] = '/path/to/the/controllers';

        return $paths;
    })
);

```

Usage
-----

[](#usage)

### Route Annotation

[](#route-annotation)

#### Controller

[](#controller)

```
use Saxulum\RouteController\Annotation\Route;

/**
 * @Route("/{_locale}")
 */

```

#### Method

[](#method)

```
use Saxulum\RouteController\Annotation\Callback;
use Saxulum\RouteController\Annotation\Convert;
use Saxulum\RouteController\Annotation\Route;

/**
 * @Route("/hello/{name}",
 *      bind="hello_name",
 *      asserts={"name"="\w+"},
 *      values={"name"="world"},
 *      converters={
 *          @Convert("name", callback=@Callback("__self:convertName"))
 *      },
 *      method="GET",
 *      requireHttp=false,
 *      requireHttps=false,
 *      before={
 *          @Callback("__self:beforeFirst"),
 *          @Callback("__self::beforeSecond")
 *      },
 *      after={
 *          @Callback("__self:afterFirst"),
 *          @Callback("__self::afterSecond")
 *      }
 * )
 */

```

- `__self` get replaced by the controller class.
- `__self:beforeFirst` calls the method `beforeFirst` on the controller instance
- `__self::beforeSecond` calls the static method `beforeSecond` on the controller

### Dependency Injection Annotation

[](#dependency-injection-annotation)

If there is no DI annotation, the controller will be registred without any dependencies as long there is at least one method route annotation.

#### Container Injection

[](#container-injection)

```
use Saxulum\RouteController\Annotation\DI;

/**
 * @DI(injectContainer=true)
 */

```

#### Service Injection

[](#service-injection)

```
use Saxulum\RouteController\Annotation\DI;

/**
 * @DI(serviceIds={"url_generator"})
 */

```

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity76

Established project with proven stability

 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 ~49 days

Recently: every ~147 days

Total

15

Last Release

3800d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.3.3

1.3.0PHP &gt;=5.3.9,&lt;8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/55048de83ca5e5d8c67164a19c78edcaad413b0c1a4ae10d92edf8d77bedd90f?d=identicon)[dominikzogg](/maintainers/dominikzogg)

---

Top Contributors

[![dominikzogg](https://avatars.githubusercontent.com/u/1011217?v=4)](https://github.com/dominikzogg "dominikzogg (77 commits)")

---

Tags

controllerroutesilexsaxulum

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saxulum-saxulum-route-controller-provider/health.svg)

```
[![Health](https://phpackages.com/badges/saxulum-saxulum-route-controller-provider/health.svg)](https://phpackages.com/packages/saxulum-saxulum-route-controller-provider)
```

###  Alternatives

[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[pestphp/pest-plugin-drift

The Pest Drift Plugin

734.0M74](/packages/pestphp-pest-plugin-drift)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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