PHPackages                             jlaso/slim-routing-manager - 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. jlaso/slim-routing-manager

ActiveLibrary[Framework](/categories/framework)

jlaso/slim-routing-manager
==========================

An approximation to the Symfony's routing system in SlimFramework

3384PHP

Since Nov 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jlaso/slim-routing-manager)[ Packagist](https://packagist.org/packages/jlaso/slim-routing-manager)[ RSS](/packages/jlaso-slim-routing-manager/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/9c866188e48fe117361245ee60d235deb8fdd8d9185256a5322040a931333eb3/68747470733a2f2f706f7365722e707567782e6f72672f6a6c61736f2f736c696d2d726f7574696e672d6d616e616765722f762f737461626c652e737667)](https://packagist.org/packages/jlaso/slim-routing-manager) [![Total Downloads](https://camo.githubusercontent.com/d6d8d5b3a8e26c6d5b26ed4134813a36b174fdf127dda9d7bd578244139e59b1/68747470733a2f2f706f7365722e707567782e6f72672f6a6c61736f2f736c696d2d726f7574696e672d6d616e616765722f646f776e6c6f6164732e737667)](https://packagist.org/packages/jlaso/slim-routing-manager) [![Latest Unstable Version](https://camo.githubusercontent.com/49a1bf6ec76ade488c32ed29ead7db427bd1a05c3f616fac4368edccdb23b313/68747470733a2f2f706f7365722e707567782e6f72672f6a6c61736f2f736c696d2d726f7574696e672d6d616e616765722f762f756e737461626c652e737667)](https://packagist.org/packages/jlaso/slim-routing-manager) [![License](https://camo.githubusercontent.com/c2c81aed95daaae4cfca23be89add79f2ae0f04b2303a346cb08b4d9e8fca6d1/68747470733a2f2f706f7365722e707567782e6f72672f6a6c61736f2f736c696d2d726f7574696e672d6d616e616765722f6c6963656e73652e737667)](https://packagist.org/packages/jlaso/slim-routing-manager)

This is an improvement to SlimFramework that permits to declare routes with the style of Symfony2

If you want to see a real demo you can clone [this repository](https://www.github.com/jlaso/slim-routing-manager-sample) and launch composer install

or to visit [this post](http://www.jaitec.net/blog/improving-the-behaviour-of-slimframework-with-a-routing-manager) to see a complete demo in action

The idea is to have this structure in the front controller (normally index.php)

```
new RoutingCacheManager(
  array(
    'cache'      => __DIR__ . '/cache/routing',
    'controller' => __DIR__ . '/app/controller',
  )
);

```

The default values of cache and controller are exactly the shown, i.e. the previous sentence is equivalen to:

```
new RoutingCacheManager();

```

And the 'controller' key accept a path or an array of paths, for instance:

```
new RoutingCacheManager(
   array(
      'cache'      => __DIR__ . '/cache/routing',
      'controller' => array(
         __DIR__ . '/app/controller',
         __DIR__ . '/app/subcontroller',
        )
    )
);

```

Obviouslly the 'cache' path must to be write rights for the http/apache daemon user.

The idea is that RoutingCacheManager process the xxxxController classes that exist in the path/paths and creates for each one a Slim loader version.

Let see an example.

This is the content of app/controller/FrontendController.php

```
    class FrontendController extends Controller
    {
      /**
       * @Route('/')
       * @Name('home.index')
       */
       public function sampleRouteAction()
       {
            /** @var Slim\Slim $slim */
            $slim = $this->getSlim();
            $slim->response()->body('This is the home route ' . $this->getName());
       }
    }

```

As you can see the annotations are very clear and reflect clearly the intention of this route endopoint

The problem is that Slim doesn't understand this structure and we need to pass to this format:

```
$app->map("/", function(){ blah blah blah })->via("GET")->name("home.index");

```

Then our SlimRoutingManager process the FrontendController class and creates a little loader with the Slim flavour:

```
$app->map("/", "FrontendController::___sampleRouteAction")->via("GET")->name("home.index");

```

The main Controller class does the magic changing the invocation of this pseudo static method \_\_sampleRouteAction to the correct method.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f19216fd9d91bd7cfff14362e2ddb5728bd2d8f50d2e0174626fc61510ed33b?d=identicon)[jlaso](/maintainers/jlaso)

---

Top Contributors

[![jlaso](https://avatars.githubusercontent.com/u/1332197?v=4)](https://github.com/jlaso "jlaso (11 commits)")

### Embed Badge

![Health badge](/badges/jlaso-slim-routing-manager/health.svg)

```
[![Health](https://phpackages.com/badges/jlaso-slim-routing-manager/health.svg)](https://phpackages.com/packages/jlaso-slim-routing-manager)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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