Slim Framework is a framework created in 2013.
#550on PLDB | 11Years Old |
git clone https://github.com/slimphp/Slim
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
require __DIR__ . '/../vendor/autoload.php';
$app = AppFactory::create();
$app->get('/hello/{name}', function (Request $request, Response $response, array $args) {
$name = $args['name'];
$response->getBody()->write("Hello, $name");
return $response;
});
$app->run();