Skip to content
This repository was archived by the owner on May 3, 2020. It is now read-only.
 
 

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slim Controllers

Slim Controllers is an extremely lightweight framework to provide controllers for Slim 4.

Installation

composer require icosillion/slim-controllers

Usage

Use Slim's groups to group your controller actions together in your main Slim file.

<?php

use Slim\App;

$app = new App();

$app->group('/', function () use ($app) {
    $controller = new RootController($app);

    $app->get('', $controller('index'));
});

$app->run();

Extend your controller from the Controller class.

<?php

use Icosillion\SlimControllers\Controller;
use Slim\Http\Request;
use Slim\Http\Response;

class RootController extends Controller
{
    public function index(Request $request, Response $response, array $args)
    {
        $response->getBody()->write('Hello World!');

        return $response;
    }
}

License

This project is licensed under the MIT license. A copy of this is available in the LICENSE file.

About

Slim Controllers is an extremely lightweight controller framework for Slim 3

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages