2017 © Pedro Peláez
 

library slim-controller

Controller extension for Slim

image

ollie-troward/slim-controller

Controller extension for Slim

  • Saturday, November 7, 2015
  • by ollie-troward
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Slim Controller for the Slim Framework V2

A controller extension for the Slim Framework V2., (*1)

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., (*2)

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

The Slim Controller is open-sourced software licensed under the MIT Licence., (*3)

The Versions

07/11 2015

dev-master

9999999-dev

Controller extension for Slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ollie Troward

07/11 2015

0.1

0.1.0.0

Controller extension for Slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ollie Troward

07/11 2015

dev-develop

dev-develop

Controller extension for Slim

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ollie Troward