PHPackages                             matiasnamendola/slimpower-slim - 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. [Templating &amp; Views](/categories/templating)
4. /
5. matiasnamendola/slimpower-slim

ActiveLibrary[Templating &amp; Views](/categories/templating)

matiasnamendola/slimpower-slim
==============================

Dynamically instantiated controller classes for Slim Framework

v0.0.1-alpha(9y ago)0744MITPHPPHP &gt;=5.3.0

Since Dec 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/MatiasNAmendola/slimpower-slim)[ Packagist](https://packagist.org/packages/matiasnamendola/slimpower-slim)[ Docs](https://github.com/matiasnamendola/slimpower-slim-controller)[ RSS](/packages/matiasnamendola-slimpower-slim/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (4)

SlimPower - Slim
================

[](#slimpower---slim)

[![Latest version](https://camo.githubusercontent.com/4fffb65462c07290152afb5cd60ffcf52ee75bcf06fa6d311ef5c88da64d8c0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4d61746961734e416d656e646f6c612f736c696d706f7765722d736c696d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)[![Total Downloads](https://camo.githubusercontent.com/f0226cb117a36140bd4033d0602c3cfece5d3b0168fab5dac450d7a8a8c75a9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4d61746961734e416d656e646f6c612f736c696d706f7765722d736c696d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)

[![Latest Stable Version](https://camo.githubusercontent.com/325cef261d4b0c2cea8b14b19fffeb6cbc6fbbb4c41e1acc592461fd8eb27791/68747470733a2f2f706f7365722e707567782e6f72672f6d61746961736e616d656e646f6c612f736c696d706f7765722d736c696d2f76657273696f6e3f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)[![Latest Unstable Version](https://camo.githubusercontent.com/10c5684a67da600e05f626cf719926f70de2bd72bb3ac3f6bf32a7ac46abc36c/68747470733a2f2f706f7365722e707567782e6f72672f6d61746961736e616d656e646f6c612f736c696d706f7765722d736c696d2f762f756e737461626c653f666f726d61743d666c61742d737175617265)](//packagist.org/packages/matiasnamendola/slimpower-slim)[![Total Downloads](https://camo.githubusercontent.com/ab3e816bf46ee71d879fead43d76b5aa65778a2902d0b60debe2f88cb4e23254/68747470733a2f2f706f7365722e707567782e6f72672f6d61746961736e616d656e646f6c612f736c696d706f7765722d736c696d2f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)[![Monthly Downloads](https://camo.githubusercontent.com/d93876d8ffccbab6ec00a9ab17d03f5914bb36bfa3cf48d03c6de3da1e5cdea0/68747470733a2f2f706f7365722e707567782e6f72672f6d61746961736e616d656e646f6c612f736c696d706f7765722d736c696d2f642f6d6f6e74686c793f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)[![Daily Downloads](https://camo.githubusercontent.com/39d924f21401b09ec9a5976ed7d516b237b33a6a955e9e41abb760e12725a481/68747470733a2f2f706f7365722e707567782e6f72672f6d61746961736e616d656e646f6c612f736c696d706f7765722d736c696d2f642f6461696c793f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)[![composer.lock available](https://camo.githubusercontent.com/5b28dbe854d51a5013d6413e95e369bdf85928a533c748158c2f240f6050d5c4/68747470733a2f2f706f7365722e707567782e6f72672f6d61746961736e616d656e646f6c612f736c696d706f7765722d736c696d2f636f6d706f7365726c6f636b3f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/matiasnamendola/slimpower-slim)

An extension to [Slim Framework](http://www.slimframework.com/) that allows you use to dynamically instantiated controllers with action methods wherever you would use a closure or callback when routing.

The controller can optionally be loaded from Slim's DI container, allowing you to inject dependencies as required.

Additionally, this extension implements Json Middleware &amp; View with great ease.

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

[](#installation)

Look at [Installation File](INSTALLATION.md)

Usage - Dynamic controller instantiation
----------------------------------------

[](#usage---dynamic-controller-instantiation)

Use the string format `{controller class name}:{action method name}`wherever you would usually use a closure:

e.g.

```
require 'vendor/autoload.php';

$app = new \SlimPower\Slim\Slim();

$app->get('/hello:name', 'App\IndexController:home');
```

You can also register the controller with Slim's DI container:

```
