PHPackages                             ollie-troward/slim-controller - 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. ollie-troward/slim-controller

ActiveLibrary[Framework](/categories/framework)

ollie-troward/slim-controller
=============================

Controller extension for Slim

0.1(10y ago)014MITPHP

Since Nov 7Pushed 10y agoCompare

[ Source](https://github.com/ollie-troward/slim-controller)[ Packagist](https://packagist.org/packages/ollie-troward/slim-controller)[ RSS](/packages/ollie-troward-slim-controller/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

Slim Controller for the Slim Framework V2
=========================================

[](#slim-controller-for-the-slim-framework-v2)

A controller extension for the Slim Framework V2.

About
-----

[](#about)

A quick way to define your controller routes and functions. Placing them in classes opposed to anonymous functions using a lightweight extensible class for your controllers.

Usage
-----

[](#usage)

```
# Instantiate your Slim application.
$app = new \Slim\Slim();

# If you're using a namespace, include it here.
$config = [
    'namespace' => 'My\\Controller\\Namespace'
];

# Include the SlimController class in your bootstrap file.
$controller = new \Troward\SlimController\SlimController($app, $config);

# Define your routes, you can use GET, POST, PUT and DELETE.
$routes = [
    'GET' => [
        # You need to define the URI as the key and the Controller@method as the value.
        '/' => 'ControllerClassName@controllerMethod',

        # Some examples are below
        'hello' => 'HelloController@index',
        'hello/:id' => 'HelloController@show'
    ]
];

# Register your routes in the SlimController.
$controller->routes($routes);

# Run your application.
$app->run();
```

Licence
-------

[](#licence)

The Slim Controller is open-sourced software licensed under the [MIT Licence](http://opensource.org/licenses/MIT).

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

3890d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8350259?v=4)[Ollie Troward](/maintainers/ollie-troward)[@ollie-troward](https://github.com/ollie-troward)

---

Top Contributors

[![ollie-troward](https://avatars.githubusercontent.com/u/8350259?v=4)](https://github.com/ollie-troward "ollie-troward (15 commits)")

### Embed Badge

![Health badge](/badges/ollie-troward-slim-controller/health.svg)

```
[![Health](https://phpackages.com/badges/ollie-troward-slim-controller/health.svg)](https://phpackages.com/packages/ollie-troward-slim-controller)
```

PHPackages © 2026

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