This is a form repo of slim framework from slim/slim with some update like middleware arguments, return object response into a json string, etc. Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

3.4.3 2016-08-23 06:28 UTC


Build Status Coverage Status Total Downloads License

Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs.


It's recommended that you use Composer to install Slim.

$ composer require slim/slim "^3.0"

This will install Slim and all required dependencies. Slim requires PHP 5.5.0 or newer.


Create an index.php file with the following contents:


require 'vendor/autoload.php';

$app = new Slim\App();

$app->get('/hello/{name}', function ($request, $response, $args) {
    $response->write("Hello, " . $args['name']);
    return $response;


You may quickly test this using the built-in PHP server:

$ php -S localhost:8000

Going to http://localhost:8000/hello/world will now display "Hello, world".

For more information on how to configure your web server, see the Documentation.

Additional Features

  • Return an object from controller into json string
  • Additional arguments for middleware
$mw = function ($request, $response, $next, $arg1, $arg2) {
    $response = $next($request, $response);

    return $response;

$app->get('/hello/{name}', function ($request, $response, $args) {
    $response->write("Hello, " . $args['name']);
    return $response;
})->add($mw, ['first_argument', 'second_argument']);


To execute the test suite, you'll need phpunit.

$ phpunit


Please see CONTRIBUTING for details.

Learn More

Learn more at these links:


If you discover security related issues, please email instead of using the issue tracker.



The Slim Framework is licensed under the MIT license. See License File for more information.